Skip to main content
Participating Frequently
November 4, 2011
Answered

Swap Image onclick for Drop-Down Hotspot

  • November 4, 2011
  • 2 replies
  • 1223 views

I'm using RoboHelp 8 to generate WebHelp output.

In a handful of help topics I've included a button image (bttn_moreHelp_up.jpg) as a drop-down hotspot. When the image is clicked, the drop-down text appears as expected. What I'd like to do is also swap the image when clicked (to bttn_moreHelp_down.jpg) and then change it back when clicked again. The images have twisty arrows to show expanded or collapsed.

Is there something I can add or tweak in the HTML to swap the image? Here's what the HTML currently looks like:


<p><a class="dropspot" href="javascript:TextPopup(this)" id="a1"><img src="images/icons/bttn_moreHelp_up.jpg"
  alt="" style="border: none;" width="132" height="21" border="0" /></a></p>
<div class="droptext" id="POPUP312575649" style="display: none;">
<p>Line 1 of text that appears in drop-down.</p>
<p>Line 2 of text that appears in drop-down. </p>
<p>Line 3 of text that appears in drop-down. </p>
</div>
<?rh-script_start ?><script type="text/javascript" language="JavaScript1.2">//<![CDATA[
if( typeof( TextPopupInit ) != 'function' ) TextPopupInit = new Function();
TextPopupInit('a1', 'POPUP312575649');
//]]></script><?rh-script_end ?>

Note: I don't want to update the CSS for the drop-down hotspots because I don't want to change every drop-down instance in the project - just the handful that use the image.


Thanks in advance!

Tricia

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Peter Grainge

See if the Twisties page on my site helps.

http://www.grainge.org/pages/authoring/twisty/twisty.htm


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

2 replies

Peter Grainge
Community Expert
Peter GraingeCommunity ExpertCorrect answer
Community Expert
November 5, 2011

See if the Twisties page on my site helps.

http://www.grainge.org/pages/authoring/twisty/twisty.htm


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.
ttrujilloAuthor
Participating Frequently
November 11, 2011

Thank you, Peter. I used the twisty2a.js file and followed the directions you outlined and it works great. I can use my button image for a drop-down hotspot and swap the entire image when clicked to indicate when it's expanded. And this method allows me to do this in only a select few spots so my other drop-down text links in the help project are unchanged.