know if mouse out, i can do it backwards, so that onmouseover, wait to show the marker, or kill the call if the mouse is out of the marker.
by sebababi
HTML
<div class="tooltip"style="display:none;">here you have the tooltip</div>
JavaScript
$(document).mouseenter(function(){
var someElement = $(this),
timeoutId = setTimeout(function(){
someElement.find(".tooltip").fadeIn("slow");
}, 1000);
someElement.data('timeoutId', timeoutId);
}).mouseleave(function(){
clearTimeout($(this).data('timeoutId'));
$(this).find(".tooltip").fadeOut("slow");
});
/* this works the other way around */
$(" #someElement").mouseenter(function(){
clearTimeout($(this).data('timeoutId'));
$(this).find(".tooltip").fadeIn("slow");
}).mouseleave(function(){
var someElement = $(this),
timeoutId = setTimeout(function(){
someElement.find(".tooltip").fadeOut("slow");
}, 1000);
//set the timeoutId, allowing us to clear this trigger if the mouse comes back over
someElement.data('timeoutId', timeoutId);
});