Simulate Hover in jQuery

后端 未结 5 1208
北恋
北恋 2020-12-25 13:33

Currently, I have some jQuery/Javascript code that toggles the css class \'ui-state-hovered\' when a user hovers the mouse over certain elements, and I want to write a test

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-25 14:20

    Write function on hover

    $('.someClass li:first').hover(function(){
          return $(this).attr('class').indexOf('ui-state-hovered') > -1;
    });
    

提交回复
热议问题