I\'m using this code in my site and I was wondering how I could add a delay to the mouseleave function
$target.mouseenter(function(e){
var $t
(function($){
$.fn.lazybind = function(event, fn, timeout, abort){
var timer = null;
$(this).bind(event, function(){
timer = setTimeout(fn, timeout);
});
if(abort == undefined){
return;
}
$(this).bind(abort, function(){
if(timer != null){
clearTimeout(timer);
}
});
};
})(jQuery);
$('#tooltip').lazybind(
'mouseout',
function(){
$('#tooltip').hide();
},
540,
'mouseover');
http://www.ideawu.com/blog/2011/05/jquery-delay-bind-event-handler-lazy-bind.html