Conditionally Change Dropdown Heading Text on Open or Close

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.
Post Reply
Boone
Propeller Head
Posts: 44
Joined: Thu Jan 31, 2008 10:24 am

Conditionally Change Dropdown Heading Text on Open or Close

Post by Boone »

Is there a way to get dropdown heading text to conditionally change when the dropdown is opened and closed? For example, if a dropdown heading said "View Instructions", is there a way to get it to change to "Close instructions" when the dropdown is opened, then change back to "View Instructions" when closed? I'm using Flare V7 and HTML Help output.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Conditionally Change Dropdown Heading Text on Open or Close

Post by i-tietz »

Dropdowns open when you click on the head, because Flare inserts a link with a javascript function call which is triggered "onclick". You can see the onclick content when you open the source of a topic in the HTML Help.
What you can do is to add an additional onclick action, that rewrites the content of the "dropdownhotspot". You could easily do that with two simple javascripts.

You stuff both javascripts into the topic or into the template or even into the masterpage.

1. Triggered "onload" of the topic:
It inserts the onclick javascript function call into the dropdownhotspot (= an <a> tag inside the DropDownHead)
If you don't want every dropdown to behave that way, you assign a specific class to those dropdownheads that are supposed ot behave that way. Only those get the additional onclick function call.
This is difficult to add in single topics - chose template or masterpage instead so the editor doesn't have to edit the source code.

2. Triggered "onclick" of the link:
In the javascript you find the clicked link and rewrite the link's content (innerHTML).
Inge____________________________
"I need input! - Have you got input?"
Post Reply