jQuery hide div on mouseout

前端 未结 3 1135
梦如初夏
梦如初夏 2021-01-05 08:39

I saw a lot of posts on this item, but couldn\'t find the right solution. Sorry if it\'s already answered somewhere.

What I want: I have a DIV

3条回答
  •  走了就别回头了
    2021-01-05 08:59

    Edit: Sorry misread the question the first time. I had to do this a couple of times, and I always moved the menu a pixel up so that it would overlap the href element. And then show/hide the menu if the href OR href elements are being hovered.

    $("#menu_opener, #menudiv").hover(
        function(){
            $("#menudiv").show();
        },
        function(){
            $("#menudiv").hide();
        }
    );
    

    And set the top property for the menudiv's style so it moves up and is overlapping the href.

    
    
    

提交回复
热议问题