pageX/Y
gives the coordinates relative to the<html>
element in CSS pixels.-
clientX/Y
gives the coordinates relative to the viewport in CSS pixels. screenX/Y
gives the coordinates relative to the screen in device pixels.
pageX/Y
提供了相对于<html>
元素的以CSS像素度量的坐标。
clientX/Y
提供了相对于viewport的以CSS像素度量的坐标。
screenX/Y
提供了相对于屏幕的以设备像素进行度量的坐标。
90%的时间你将会使用pageX/Y
;通常情况下你想知道的是相对于文档的事件坐标。其他的10%时间你将会使用clientX/Y
。你永远不需要知道事件相对于屏幕的坐标。