How do I check if the mouse is over an element in jQuery?

前端 未结 24 2137
不思量自难忘°
不思量自难忘° 2020-11-22 08:10

Is there a quick & easy way to do this in jQuery that I\'m missing?

I don\'t want to use the mouseover event because I\'m already using it for something else. I

24条回答
  •  花落未央
    2020-11-22 09:04

    $(document).hover(function(e) {
        alert(e.type === 'mouseenter' ? 'enter' : 'leave');
    });
    

    FIDDLE

提交回复
热议问题