jquery当中bind和unbind,pageX,pageY,.screenX, screenY是怎么用的?
例 2.2(e.pageXscreenX.html)
<script language="javascript" src="jquery.min.js"></script>
<script language="javascript">
$(function(){undefined
/*马克-to-win:和原来一样,pageX指窗口里,screenX指屏幕,所以多了一个上面的菜单。*/
$("body").bind("click", fn1 = function(e){
var posPage = "(" + e.pageX + "," + e.pageY + ")";
var posScreen = "(" + e.screenX + "," + e.screenY + ")";
$("span").html("
Page: " + posPage + "
Screen: " + posScreen);
});
$("input[type=button]").click(function(){undefined
$("body").unbind("click",fn1); //移除事件监听myFunc1
});
});
</script>
sgkls
sfdgsdg
gf
fsdf
fgdsf
sdf
sdfdsf
sdfsd
更多内容请见原文,文章转载自:https://blog.csdn.net/qq_44594371/article/details/103062825