$('.xx').mouseenter(function(){
if($(this).is(':hover'))
alert('d');
else
alert('f');
});
Here is my code, it should alert 'd' but every time it alerts 'f' What's error Here
x.filter(':hover').length
This may be also usable when you already had queried some objects / or inside callback function.
:hover is a CSS pseudo-class, not a jQuery selector. It cannot be reliably used with is() on all browsers.
function idIsHovered(id){
return $("#" + id + ":hover").length > 0;
}
http://jsfiddle.net/mathheadinclouds/V342R/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With