jQuery事件小结

Original 2018-11-18 13:38:20 225
abstract:<!DOCTYPE html><html><head> <title>jQuery事件</title> <script type="text/javascript" src="js/jquery-3-3.1.min.js"></script> <script type=

<!DOCTYPE html>

<html>

<head>

<title>jQuery事件</title>

<script type="text/javascript" src="js/jquery-3-3.1.min.js"></script>

<script type="text/javascript">


</script>

</head>

<body>

<script type="text/javascript">

// mouseover() 当鼠标指针位于元素上方时会发 mouseover事件

// mouseenter() 当鼠标指针穿过元素时会发生 mouseenter事件

// mousemove() 当鼠标在指定元素中移动时,就会发生该事件

// mouseleave() 当鼠标指针离开元素时

// mouseout() 当鼠标指针从元素移开时

// mousedown() 当鼠标指针移动到元素上方并按下鼠标按键时

// mouseup() 当在元素上松开鼠标按键时

// resize() 当调整当前浏览器窗口大小时

// pageX() 属性是鼠标指钍的位置,相对于文档的左边缘

// pageY() 属性是鼠标指针的位置,相对于文档的上边缘

$(document).ready(function(){

$(document).mousemove(function(aa){

$('span').text('x: '+aa.pageX+'y: '+aa.pageY)

})


})

</script>


<div>

当前鼠标的位置:<span> </span>

</div>

</body>

</html>

我测试到,没有显示鼠标位置显示 

Release Notes

Popular Entries