Jquery condition check is(':hover') not working

后端 未结 8 1339
-上瘾入骨i
-上瘾入骨i 2020-11-28 15:15
$(\'.xx\').mouseenter(function(){
  if($(this).is(\':hover\'))
    alert(\'d\');
  else
     alert(\'f\');
});

Here is my code, it should alert \'d

8条回答
  •  一整个雨季
    2020-11-28 15:46

    x.filter(':hover').length
    

    This may be also usable when you already had queried some objects / or inside callback function.

提交回复
热议问题