jquery當(dāng)中mouseover和Mouseout和mousemove的用法是什么
例 1.12(mouseoverMouseout$Document.html)
馬克- to-win:馬克 java社區(qū):防盜版實(shí)名手機(jī)尾號: 73203。
<html>
<head>
<title>設(shè)置opacity</title>
<style type="text/css">
<!--
img{
border:1px solid #FFFFFF;
}
-->
</style>
<script language="javascript" src="jquery.min.js"></script>
<script language="javascript">
$(function(){
//設(shè)置透明度,兼容性很好
$("img").mouseover(function(){
$(this).css("opacity","0.6");
});
$("img").mouseout(function(){
$(this).css("opacity","1.0");
});
/*馬克-to-win:下面頭兩段程序在火狐下效果完全一樣, 都能運(yùn)行, (2在火狐下可以,3火狐不行。但ie下2不行,1,3兩段在ie上
是一樣的 ),這個例子最重要的是讓我看到了$(document)和document的區(qū)別。但
jquery會更兼容 */
$(document).mousemove(function(event){
$("span").text(event.clientX + ", " + event.clientY);
});
// document.onmousemove=function(event){
// $("span").text(event.clientX + ",, " + event.clientY);
// };
/* document.onmousemove=function(){
$("span").text(event.clientX + ",,, " + event.clientY);
}; */
});
</script>
</head>
<body>
<img src="markWeChat.jpg">
<span></span>
</body>
</html>