Welcome Guest, Not a member yet? Register   Sign In
[solved] jquery - How to stop mouseout event when hovering over child elements???
#1

[eluser]umbungo[/eluser]
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)

Code:
$(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


Messages In This Thread
[solved] jquery - How to stop mouseout event when hovering over child elements??? - by El Forum - 07-23-2011, 02:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB