We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5282
    • 147 Posts
    Hi !
    I’d like To use a little javascript library in my dropmenu, which will display tooltips as the mouse goes over the links
    i found a quite good js library :
    http://www.knopper.net/knoppix

    ( there are tooltips on most of the links at the top of the page )

    but to use this script i have to add those attributes to the links tags :
    onMouseOver="tip(’the tip name’)" onMouseOut="untip()"

    i don’t know anything about php ... but i searched the dropmenu a little, i think there are only 3 lines to modify :
    ’<a href="[~’.$child[’id’].’~]" title="’.$child[$titleOfLinks].’">’.$pre.$child[$textOfLinks].$post.’</a>’;
    ( there are 3 similar lines like this one, and these are the only ones in the snippet with <a></a> tags )

    i’d like to add this attribute to the links tags :
    onMouseOver="tip(’alias of the document’)"
    in the 3 lines of the snippet, but i don’t know how i can do that ( i only know xhtml/css smiley )

    thanks in advance

      i’m not a native english speaker, sorry if there are any mistakes ! smiley

      Pikkitux.com Website about Ubuntu Linux, Website Creation, and many other how-tos, tips and tricks ... ( French Language, and of course Modx Powered ! )
      • 25663 MODX Staff
      • 12,272 Posts
      You would in fact just add those lines in. Half the fun of MODx is trying things and seeing if they work. Just make a duplicate of the snippet named something like ToolTipMenu and start hacking away!
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 5282
        • 147 Posts
        yes, but the only thing is that i don’t know the document-specific variable syntax, is it
        onMouseOver="tip(’alias’)"
        or
        onMouseOver="tip([’alias’])" huh?

        or maybe

        onMouseOver="[~’.$child[’alias’].’~]" ??

        ( i’m a lazy person smiley )



        good night
        ( from paris smiley )
          i’m not a native english speaker, sorry if there are any mistakes ! smiley

          Pikkitux.com Website about Ubuntu Linux, Website Creation, and many other how-tos, tips and tricks ... ( French Language, and of course Modx Powered ! )
          • 25663 MODX Staff
          • 12,272 Posts
          try tip(’[*alias*]’) for the alias, or any other document variable, like introtext for the sumarry or longtitle for the long page title.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            But [*alias*] would give the links the alias for the current document, not the alias for the document being linked to.

            <a href="[~'.$child['id'].'~]" title="'.$child[$titleOfLinks].'" onmouseover="tip('".$child['alias']."')">


            should do the trick.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Why do you want to use a javascript to do this? All you have to do is call the snippet like this:

              [!DropMenu?startDoc=`xx` &titleOfLinks=`alias`!]


              to generate a title for the link. By default, it’s the description. You can put anything you want in the description field when you edit the document.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 9814
                • 8 Posts
                Quote from: sottwell at Feb 12, 2006, 06:01 PM

                Why do you want to use a javascript to do this?  All you have to do is call the snippet like this:

                [!DropMenu?startDoc=`xx` &titleOfLinks=`alias`!]


                to generate a title for the link.  By default, it’s the description.  You can put anything you want in the description field when you edit the document.

                Because tooltips are cooler than a title, and they can show more stuff than just text.

                I’m interested in doing this as well!
                  • 5282
                  • 147 Posts
                  yes with regular html titles, the length of the tooltip is very limited, moreover this javascript library allows to choose colors, and even to embed html in the tooltip smiley
                    i’m not a native english speaker, sorry if there are any mistakes ! smiley

                    Pikkitux.com Website about Ubuntu Linux, Website Creation, and many other how-tos, tips and tricks ... ( French Language, and of course Modx Powered ! )