当前位置:网站首页>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

边栏推荐
- Record MySQL troubleshooting caused by disk sector damage
- 嵌入式系统
- Mongodb: I. what is mongodb? Advantages and disadvantages of mongodb
- What is a port scanning tool? What is the use of port scanning tools
- 【Unity Shader 消融效果_案例分享】
- 产品学习(一)——结构图
- 清除过期缓存条目后可用空间仍不足 - 请考虑增加缓存的最大空间
- C#如何打印輸出原版數組
- 问题:OfficeException: failed to start and connect(三)
- What are the functions of LAN monitoring software
猜你喜欢

idea 好用插件汇总!!!

Design of sales management system for C language course (big homework)

ESP32在电池供电时用ULP监测电池电压
![[wechat applet low code development] second, resolve the code composition of the applet in practice](/img/ab/28ab01db84b1437220e659118b2871.png)
[wechat applet low code development] second, resolve the code composition of the applet in practice

Record MySQL troubleshooting caused by disk sector damage

mysql学习

SQL语句

NOC 设计的一些坑

C语言课设物业费管理系统(大作业)

Application of IT service management (ITSM) in Higher Education
随机推荐
Interview questions for HW (OD) post
Notes on probability theory
Router 6/ 以及和Router5 的区别
What are the functions of LAN monitoring software
C language course set up salary management system (big homework)
[network security tool] what is the use of USB control software
码力十足学量化|如何在财务报告寻找合适的财务公告
[ManageEngine Zhuohao] helps Julia college, the world's top Conservatory of music, improve terminal security
PAT (Advanced Level) Practice 1057 Stack
Comment imprimer le tableau original
产品学习(一)——结构图
问题:OfficeException: failed to start and connect(二)
idea 好用插件汇总!!!
ESP32 ESP-IDF ADC监测电池电压(带校正)
Common shortcut keys
C语言课设图书信息管理系统(大作业)
Promise
问题:OfficeException: failed to start and connect(三)
Chapter V input / output (i/o) management
SQL语言的学习记录一