Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Auto expand drop downs - extended to nested drop downs

New Here ,
Jun 17, 2009 Jun 17, 2009

Hi all,

I have been looking today at Peter Grainge's script for auto-expanding a drop down text section when called from a link (ref http://www.grainge.org/pages/authoring/autoexpand/auto_expand_method_2.htm)

I first of all can confirm that this works in RH8, although the script calls two standard "kadov" functions which have been replaced, but Adobe were kind enough to handle instances of these being called, and direct them to the new non-kadov scripts instead. But the following section can be updated

from:

function openlink(){

y=window.location.hash.substring(1);

if (!y) return;

x=document.getElementById(y);

kadovTextPopupOnLoad(x);

kadovTextPopup(x);

}

to:

function openlink(){

y=window.location.hash.substring(1);

if (!y) return;

x=document.getElementById(y);

TextPopupOnLoad(x);

TextPopup(x);

}

...to remove the Kadov refs.

What I wanted to do with this was to have a way of opening up drop down text that is nested within other drop down text sections on the page. To achieve this I've modified the function as follows:

function openlink()
{
substr=window.location.hash.substring(1);
posn=substr.indexOf("#"); //finds if there is more than one #
if (posn == -1)
  {
   y = substr;
  }
while (posn > -1)
  {
  var temp = new Array();
  temp = substr.split('#'); //splits the URL #ID variables into array items
  y = temp[0];
  z = temp[1];
  v = temp[2];
  posn = posn-1;
  };
if (!y) return;
x=document.getElementById(y);
TextPopupOnLoad(x);
TextPopup(x);
if (!z) return;
w=document.getElementById(z);
TextPopupOnLoad(w);
TextPopup(w);
if (!v) return;
u=document.getElementById(v);
TextPopupOnLoad(u);
TextPopup(u);
}

What this allows is for a link to call the page and define up to 3 levels of nested drop downs to be opened, identifying them via their ID's, e.g.

page.htm#id1#id2#id3

This works nicely in my initial testing, and I wanted to share it here for feedback and suggestions for improvement etc.. I'm not certain my code design is the most efficient, but it does the job!

The only downside is that using this script causes the "twisties" images to dissapear! If someone can figure out how to save the twisties from extinction that would be very much appreciated!! I'm guessing it's to do with the function "TextPopUpOnLoad", if I compare this with "TextPopUp" I can see that the latter has some code for dealing with the twistie images....

Thanks,

Mark

Message was edited by: Mark Pud - "insert raw html" option is horrible, changed to "highlight java"..

710
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2009 Jun 17, 2009

Mark

Thanks for advising the change that can be made.

I cannot help you with the script you need. Be aware that many people have tried things with dropdowns within dropdowns and I am now up to the limit of the number of people I can visit in care!


See www.grainge.org for RoboHelp and Authoring tips

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 18, 2009 Jun 18, 2009
LATEST

Haha thanks for the warning Peter!

I'm pretty happy that this works with nested drop downs, it's just the issue of the twistie images dissapearing that has me stumped....

I've also modified this with a bit of scrolling javascript action so that the page scrolls automatically down to the location of the target link (using Bookmarkscroll) which works nicely.. as long as the nested dropdowns are called in the right order in the link, it will scroll to each one as it opens up!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp