JQuery中使用on方法绑定hover事件实例
(编辑:jimmy 日期: 2025/5/13 浏览:3 次 )
文本教你用on方法,模拟hover方法。
代码如下:
复制代码 代码如下:
$(obj).on("mouseover mouseout",function(event){
if(event.type == "mouseover"){
//鼠标悬浮
}else if(event.type == "mouseout"){
//鼠标离开
}
})
赶紧去试试吧~
下一篇:jQuery实现HTML5 placeholder效果实例