jquery hover事件

今天想做一个鼠标悬浮的事件,于是习惯性的使用 

$(DOM).on("hover",function(){});

实际上上述代码是错误的 

查看了DHTML帮助手册,发现没有 onhover事件,只有

jquery 提供了hover方法,示例如下:

<div style="border: 1px solid red;height: 200px;width: 200px;" id="hoverWidget">
	dasfdsaf
</div>
<script>
$("#hoverWidget").hover(function(){
	console.log("in");
},function(){
	console.log("out");
})
</script>

猜你喜欢

转载自hbiao68.iteye.com/blog/2366328