Alternative Jquery mouse event

前端 未结 1 1186
死守一世寂寞
死守一世寂寞 2021-01-26 06:52

Alright so the code below works fine if I click outside the #nav div. I was asking if it is possible to just move the mouse away from the #nav div to make it disappear. I don\'t

相关标签:
1条回答
  • 2021-01-26 07:15

    Assign a function that hides the element on the mouseleave event.

    $("#nav").mouseleave(function(){
        $(this).hide(); 
    });
    

    Fiddle: http://jsfiddle.net/howderek/SRMT8/

    0 讨论(0)
提交回复
热议问题