I guess you are using some code like this:
$("a").hover(function () { // Enter
$("div").show();
}, function () { // Leave
$("div").hide();
});
In this case, your guess is correct. If the div
is floating over the a
, the mouse leave is triggered when the div
is displayed, because the mouse starts to be on the div
and not on the a
. Then, the div
is hided, the mouse enter the a
again... And all begins another time.
If you can avoid the div
to appear over (with z-index, for example), it'll be more simple.
Otherwise, I suggest you do something like this:
$("a").mouseenter(function () {
$("div").show();
});
$("div").mouseleave(function () {
$("div").hide();
});
If your mouse will be always over the div
when it's opened, then it can close itself if the mouse leaves.