delay causes a problem
delay causes a problem
Hi folks. I'm fairly new to jquery and have run into a problem. I
tried searching for this - if I missed, please send me a link.
I have created a simple mouseover popup for a client. The client wants
the popup to stay visible with the mouse over both the trigger div as
well as the popup itself, and he wants a delay in the popup
disappearing on mouseout.
But when I use setTimeout to delay having the popup disappear, it
screws up the performance. The main thing is that I lose the dual/div
trigger of the popup. Only the original mouseover trigger div works to
trigger it. And sometimes there is flickering of the popup. The same
thing happened when I used a fadeout instead of setTimeout. But if I
get rid of both, it works fine.
You can see it as it is now at http://devel.indianchiefguides.com/en/germany
Mouse over the flag on the left.
This is what I'm using:
$(document).ready(function() {
$(".showinfo, #tinfo").hover(function () {
$("#tinfo").removeClass("hidden");
},
function(){
setTimeout(function() {
$("#tinfo").addClass("hidden");
}, 350);
}
);
});
Thanks for any hints!