jquery-cluetip
jquery-cluetip copied to clipboard
Use of delayedClose together with sticky / mouseOutClose
I tried to use options delayedClose together with sticky, as in: close the tooltip after 500ms when not in the tooltip. I don't want to have a close button. My version now looks like this:
if (opts.delayedClose > 0) {
if (opts.sticky) {
$this.bind('mouseenter', function() {
clearTimeout(closeOnDelay);
}).bind('mouseleave', function() {
clearTimeout(closeOnDelay);
closeOnDelay = setTimeout(cluetipClose, opts.delayedClose);
});
$cluetip.bind('mouseenter', function() {
clearTimeout(closeOnDelay);
});
} else {
closeOnDelay = setTimeout(cluetipClose, opts.delayedClose);
}
}
There may have to be a check if the option mouseOutClose is set, too.