Skip to main content
Inspiring
April 28, 2010
Question

Auto-expanded drop-downs when a page loads (RH8)

  • April 28, 2010
  • 2 replies
  • 2216 views

I'm not sure if this is possible, but can anyone tell me how to make DHTML drop-downs automatically display as expanded when a page loads?

Many thanks

Jonathan

This topic has been closed for replies.

2 replies

Peter Grainge
Community Expert
Community Expert
April 30, 2010

I'm curious as to why you are using dropdowns when you want the content automatically displayed?

I have seen people want a single dropdown expanded when the link is from another topic and the target content is in a dropdown but you haven't said that is the requirement here.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
Jop_SmithAuthor
Inspiring
May 4, 2010

I want my content to be displayed by default so that it can be read from start to finish, but I also want to give my readers the choice of collapsing sections they're not interested in, as some will be quite long. I know I could alternatively use standard dropdowns and let my readers open the sections they want to read, but someone wanting to read everything would have to manually open them all or I'd have to include your Show/Hide All script.

This seemed like a good idea last week, but I may change my mind!

Regards

Jonathan

Willam van Weelden
Inspiring
April 28, 2010

Hi,

That kind of defeats the purpose of dropdowns, don't you think? You can write a javascript to show all the dropdowns on load.

Greet,

Willam

This e-mail is personal. For our full disclaimer, please visit www.centric.eu/disclaimer.

Jop_SmithAuthor
Inspiring
April 28, 2010

I know what you're saying and it is an odd request, but for my release notes it would be useful to show every category by default but allow the user to collapse the ones they are not so interested in.

Jonathan

Willam van Weelden
Inspiring
April 30, 2010

Hi,

You can use the following script:

setTimeout("ExpandAll()", 1);
function ExpandAll()
{
    var links = document.getElementsByTagName('a');
    for(var i in links)
    {
        if(links.className == "dropspot" || links.className == "expandspot")
        {
            TextPopup(links)
        }
    }
}

Put it in your topic, or in a separate script file that you link to the topics. This script cycles through the hyperlinks in the topic and when the link is a dropdown or expandtext link, the script expands the dropdown/expandspot.

Greet,

Willam