JQuery中使用on方法绑定hover事件实例

  文本教你用on方法,模拟hover方法。

  代码如下:

  

复制代码 代码如下:

  $(obj).on("mouseover mouseout",function(event){

  if(event.type == "mouseover"){

  //鼠标悬浮

  }else if(event.type == "mouseout"){

  //鼠标离开

  }

  })

  赶紧去试试吧~