4 Replies Latest reply on Feb 23, 2015 6:39 AM by Willam van Weelden

    DHTML drop down text hot spot behavior

    earlb49998042

      DHTML drop down text - How can I make the hot spot text change from "show me" to "hide"?

        • 1. Re: DHTML drop down text hot spot behavior
          Captiv8r Adobe Community Professional & MVP

          Hi there

           

          Normally with DHTML drop down text you simply type the text you want the user to click, then select across it and make a drop-down.

           

          In your case, it would seem you (or someone) has typed "Show Me" as the text that is clickable?

           

          So is your question to say that this is what you have done, but you want the behavior to somehow be that when the user clicks the text, instead of seeing "Show Me", you want it to change so that it would then read "Hide"? (until it was clicked and it would then again change to "Show Me")

           

          I'm guessing that's possible, but it won't be a simple thing to change from inside RoboHelp. Unless, possibly you make the "text" a pair of simple images and you configure the images to be used as "Twisties".

           

          Cheers... Rick

          • 2. Re: DHTML drop down text hot spot behavior
            earlb49998042 Level 1

            Thanks, Rick! I didn't know about twisties. On your advice I checked them out and, yeah, that's exactly what I needed!

            • 3. Re: DHTML drop down text hot spot behavior
              Captiv8r Adobe Community Professional & MVP

              Sooo, all sorted now?

              • 4. Re: DHTML drop down text hot spot behavior
                Willam van Weelden Adobe Community Professional & MVP

                Oh Rick, you're making this way too easy! Seriously, who wants easy if you can make it hard ;-)

                    -- Just dropping in as this is something I did for my help projects. Perhaps someone can use it.

                 

                1. Open up ehlpdhtm.js.
                2. Find the function TextPopup (Line 2514 in RH11)
                3. Add the following code on a new line before the code 'for(var i=0; i<getChildNodes(el).length; i++)'

                 

                /* Modification */

                  var More = "Show me";

                  var Less = "Hide";

                 

                  var MoreRegExp = new RegExp(More, 'g');

                  var LessRegExp = new RegExp(Less, 'g');

                  sHTML = el.innerHTML;

                  if(MoreRegExp.test(sHTML))

                  sHTML = sHTML.replace(MoreRegExp, Less);

                  else if(LessRegExp.test(sHTML))

                  sHTML = sHTML.replace(LessRegExp, More);

                 

                  el.innerHTML = sHTML;

                 

                  /* End modification */

                 

                Don't forget to copy the modified ehlpdhtm.js in your output after generation, or update your seed file.

                 

                Kind regards,

                 

                Willam