总结: event.clientX 设置或获取鼠标指针位置相对于当前窗口的 x 坐标,其中客户区域不包括窗口自身的控件和滚动条. (可见区域)event.clientY 设置或获取鼠标指针位置相对于当前窗口的 y 坐标,其中客户区域不包括窗口自身的控件和滚动条. (可见区域)event.offsetX 设置或获取鼠标指针位置相对于触发事件的对象的 x 坐标. (触发事件的元素,ie,chrome支持此属性,ff不支持)event.offsetY 设置或获取鼠标指针位置相对于触发事件的对象的 y
event.pageX get mouse position Description: The mouse position relative to the left edge of the document. Example <script> $(document).on( "mousemove", function( event ) { console.log( "pageX: " + event.pageX + ", pageY: &qu
说到底, pageY, clientY, screenY的计算,就是要找到参考点, 它们的值就是: 鼠标点击的点----------- 和参考点指点----------的直角坐标系的距离 stackoverflow上面有个回答,讲解的非常清晰. offsetX and offsetY are relative to the parent container, whereas pageX and pageY are relative to the document // rect is a DOM