Search code examples
javascriptjquerycluetip

Close a cluetip when the mouse is off of the link


Is there an option to close a cluetip dialog when the mouse is moved off of the link? There is the mouseOutClose option, but it doesn't close the cluetip if you don't hover over it first.

Here is an example:

http://plugins.learningjquery.com/cluetip/demo/ - the first link under the jTip Theme


Solution

  • In the clueTips core file replace the code:

    if (opts.mouseOutClose) {....}
    

    with

    if (opts.mouseOutClose) {
    var closectip;
    $cluetip.hover(function() {
    clearTimeout(closectip);
    },
    function() {
    $closeLink.trigger('click');
    });
    $this.hover(function() {
    clearTimeout(closectip);
    
    }, function() {
    closectip = setTimeout(cluetipClose, 1000);
    });
    } 
    

    I found the solution from a jquery forum here is the link

    http://plugins.jquery.com/content/cluetip-doesnt-close-mouseout

    Its working for me.