Search code examples
tooltipmootools

mootools Tooltip Open


How Can i force one Mootools ToolTip (Tip) to Open?

Regards,

Pedro


Solution

  • you can try by firing the trigger event on the element that the tip is attached to.

    for example - if you have

    <a href="#" id="gethelp" class="tip" rel="Click here to sign in through facebook">what's this?</a>
    <script type="text/javascript">
    // domready etc. 
    var myTips = new Tips('a.tip');
    
    // force the gethelp one up:
    $("gethelp").fireEvent("mouseenter");
    </script>
    

    http://github.com/mootools/mootools-more/blob/master/Source/Interface/Tips.js

    you may be able to do myTips.show(element); also although the whole concept is flawed:

    mootools tooltips are basically following your mouse around as you mouseover an element. as such, they are event driven and the tooltips are pre-built in the vicinity of the target element. by showing one without the mouseenter event, it will look a bit odd...