JavaScript中的pageX/Y clientX/Y screenX/Y有什么区别? [英] What is the difference between pageX/Y clientX/Y screenX/Y in Javascript?

查看:45
本文介绍了JavaScript中的pageX/Y clientX/Y screenX/Y有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

带有视觉提示的示例将非常有帮助.

An example with some visual cue would be really helpful.

推荐答案

视觉提示表示:

屏幕→显示器的全屏(screenX/Y )
位置将始终相对于物理屏幕的视口.

The visual cues represents:

Screen → the full screen of the monitor (screenX/Y)
Position will always be relative to the physical screen's viewport.

客户端→浏览器的客户端视口(clientX/Y )
如果单击左上角的值,则滚动条的位置始终是(0,0).

Client → the client viewport of the browser (clientX/Y)
If you click in the left top corner the value will always be (0,0) independent on scroll position.

文档→完整的文档/页面( pageX/Y )
请注意, UIEvent 对象

Document → the complete document/page (pageX/Y)
Note that pageX/pageY on the UIEvent object are not standardized.

所有值均以像素为单位.

All values are in pixels.

这篇关于JavaScript中的pageX/Y clientX/Y screenX/Y有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆