cnblogs/dcrenl/screenX clientX pageX区别.html
2024-09-24 12:43:01 +08:00

3 lines
521 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>screenX:鼠标位置相对于用户屏幕水平偏移量而screenY也就是垂直方向的此时的参照点也就是原点是屏幕的左上角。</p>
<p>clientX:跟screenX相比就是将参照点改成了浏览器内容区域的左上角该参照点会随之滚动条的移动而移动。</p>
<p>pageX参照点也是浏览器内容区域的左上角但它不会随着滚动条而变动 <img src="http://images.cnitblog.com/blog/82061/201303/07210454-f730fa013b43446d99dda1898a9d5cf8.png" alt="" /></p>