【webAPI】学习累积

1.

e.clientX | e.clientY 鼠标在可视区域的位置

e.pageX | e.pageY 鼠标在页面中的位置 有兼容性问题 ie9以后才支持

e.pageY = e.clientY + 页面滚动的距离

//处理兼容性问题
document.body.scrollLeft || document.documentElement.scrollLeft
document.body.scrollTop || document.documentElement.scrollTop

猜你喜欢

转载自www.cnblogs.com/buerjiongjiong/p/12197235.html