jQuery event "looping"
Posted
by Deryck
on Stack Overflow
See other posts from Stack Overflow
or by Deryck
Published on 2010-03-25T23:25:32Z
Indexed on
2010/03/25
23:33 UTC
Read the original article
Hit count: 288
jQuery
Hi
I´m trying to code a tooltip (Yes I know, I have my reasons to avoid plugins in this case) in jQuery.
Whe I show the tooltip and leave the mouse in the same place the show and hide repeats forever. It´s like the element triggers the hover event again and again and again.
I try unbind for the event but it does not work neither.
$("td.with-tooltip").mouseover( function() {
var offset = $(this).offset();
var baseX = offset.left;
var baseY = offset.top;
var inputWidth = $(this).width();
var baseX = baseX + 50;
var baseY = baseY - $(".desc").height();
$(".desc div").html($(this).attr("title"));
$(".desc").css({"position":"absolute", "left": baseX, "top": baseY }).fadeIn();
$(this).unbind("mouseover");
}).mouseleave( function() {
$(".desc").fadeOut();
});
What can I do?
thanks.
© Stack Overflow or respective owner