当前位置:网站首页>Figure out the difference between event coordinates screenx, clientx, pagex and offsetx
Figure out the difference between event coordinates screenx, clientx, pagex and offsetx
2022-07-01 06:38:00 【song854601134】
Graphical event coordinates screenX、clientX、pageX, offsetX The difference between
One 、 The illustration

As shown in the figure , Suppose the gray dot in the page is where the mouse clicks , The yellow area is the mouse trigger event object
Two 、 Concept
1、screenX and screenY
- Reference point : The upper left corner of the computer screen
- screenX: The horizontal offset of the mouse click position relative to the upper left corner of the computer screen
- screenY: The vertical offset of the mouse click position relative to the upper left corner of the computer screen
2、clientX and clientY
- Reference point : The upper left corner of the browser content area
- clientX: The horizontal offset of the mouse click position relative to the viewable area of the browser ( The horizontal scrolling distance is not calculated )
- clientY: The vertical offset of the mouse click position relative to the viewable area of the browser ( The distance of the vertical scroll bar is not calculated )
3、pageX and pageY
- Reference point : The upper left corner of the page
- pageX: The horizontal offset of the mouse click position relative to the upper left corner of the web page , That is to say clientX Add the distance of the horizontal scroll bar
- pageY: The vertical horizontal offset of the mouse click position relative to the upper left corner of the web page , That is to say clientY Add the distance of the vertical scroll bar
4、offsetX and offsetY
- offsetX: The horizontal distance between the mouse click position and the trigger event object
- offsetY: Vertical distance of mouse click position relative to trigger event object
3、 ... and 、 Event object parameters

边栏推荐
- [network security tool] what is the use of USB control software
- 问题:OfficeException: failed to start and connect(二)
- Code power is full of quantitative learning | how to find a suitable financial announcement in the financial report
- Record MySQL troubleshooting caused by disk sector damage
- [ManageEngine Zhuohao] helps Huangshi Aikang hospital realize intelligent batch network equipment configuration management
- SQL学习笔记2
- SQL中DML语句(数据操作语言)
- 绕圆旋转动画组件,拿过来直接用
- 第五章 输入/输出(I/O)管理
- sql中TCL语句(事务控制语句)
猜你喜欢

C language course set up student elective course system (big homework)

C language course is provided with employee information management system (large operation)

C语言课设工资管理系统(大作业)

MySQL learning

Lxml module (data extraction)

清除过期缓存条目后可用空间仍不足 - 请考虑增加缓存的最大空间

嵌入式系统
![[ManageEngine] how to realize network automatic operation and maintenance](/img/8a/75332d3180f92c6a6482d881032bbf.png)
[ManageEngine] how to realize network automatic operation and maintenance

Software engineering review

8 张图 | 剖析 Eureka 的首次同步注册表
随机推荐
常用快捷键
Rotate the animation component around the circle, take it and use it directly
Detailed steps for installing redis on Windows system
嵌入式系统
[ManageEngine Zhuohao] helps Julia college, the world's top Conservatory of music, improve terminal security
Application of IT service management (ITSM) in Higher Education
问题解决:OfficeException: failed to start and connect(一)
Code power is full of quantitative learning | how to find a suitable financial announcement in the financial report
【微信小程序低代码开发】二,在实操中化解小程序的代码组成
谷粒商城-环境(p1-p27)
RestTemplate使用
SQL learning notes nine connections 2
Promise
JSON module
Free trial of self-developed software noisecreater1.1
Common shortcut keys
软件工程领域的名词描述
ESP32深度睡眠电流怎样低于10uA
PAT (Advanced Level) Practice 1057 Stack
关于变量是否线程安全的问题