有时候需要悬停和离开的时候处理一下逻辑 比如悬停的时候 弹出tips 离开的时候不显示
我下面的一个例子是图片在悬停的时候放大 离开的时候还原 图片地址填写你自己实际的路径
<img alt="" src="images/" width="450" height="450" οnmοuseοver="onmouseover_(this)" οnmοuseοut="onmouseout_(this)" style="-webkit-transition: all .4s;
-moz-transition: all .4s;
-ms-transition: all .4s;
-o-transition: all .4s;
transition: all .4s;">
//鼠标悬停经过事件
function onmouseover(obj){
alert("停在图片上")
$(obj).attr("width",500).attr("height",500);
}
//鼠标离开事件
function onmouseout_(obj){
$(obj).attr("width",450).attr("height",450);
}