I have some jquery js that is triggered whilst hovering over a DIV. However, this DIV contains an image and link, and if these child elements are hovered over, the mouseout event is triggered?? how do i prevent this?? (there is also a delay involved)
$(document).ready(function() {
var hov = '1';
$('.class').mouseenter(function(){
hov = '1';
//do stuff
});
$('.class').mouseleave(function(){
hov = '0';
setTimeout(function(){
if(hov=='0'){
//undo stuff
}
}, 300);
$('.class').mouseenter(function(){
clearTimeout();
});
});
});edit: this is most noticeable to me on IE6/7. I guess i need some code around the mouseout function saying ‘if child, then stop function’.. but i’m not sure how properly to do this??
much thanks to anyone who can help