jquery当中mouseover和Mouseout 和mousemove的用法是什么?
例 1.12(mouseoverMouseout$Document.html)
<html>
<head>
<title>设置opacity</title>
<style type="text/css">
<!--
img{undefined
border:1px solid #FFFFFF;
}
-->
</style>
<script language="javascript" src="jquery.min.js"></script>
<script language="javascript">
$(function(){undefined
//设置透明度,兼容性很好
$("img").mouseover(function(){undefined
$(this).css("opacity","0.6");
});
$("img").mouseout(function(){undefined
$(this).css("opacity","1.0");
});
/*下面头两段程序在火狐下效果完全一样, 都能运行, (2在火狐下可以,3火狐不行。但ie下2不行,1,3两段在ie上
是一样的 ),这个例子最重要的是让我看到了$(document)和document的区别。但
jquery会更兼容 */
$(document).mousemove(function(event){undefined
$("span").text(event.clientX + ", " + event.clientY);
});
// document.οnmοusemοve=function(event){undefined
// $("span").text(event.clientX + ",, " + event.clientY);
// };
/* document.οnmοusemοve=function(){undefined
$("span").text(event.clientX + ",,, " + event.clientY);
}; */
});
更多内容请见原文,文章转载自:https://blog.csdn.net/qq_44594371/article/details/103062364