当使用jquery的on函数的时候,可以给动态添加的元素增加事件,但是却没有悬浮hover函数了

可以使用这种方式模拟实现hover函数效果

 

    $("body").on("mouseover mouseout",".lineItem",function(event) {
        if(event.type == "mouseover"){
            //鼠标悬浮

        }else if(event.type == "mouseout"){
            //鼠标离开

        }
    });

 

相关文章:

  • 2022-03-02
  • 2022-12-23
  • 2021-04-17
  • 2022-01-01
  • 2021-04-23
  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
  • 2022-12-23
  • 2021-12-05
相关资源
相似解决方案