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

边栏推荐
猜你喜欢

2022 年江苏省职业院校技能大赛(中职) 网络搭建与应用赛项公开赛卷

idea 好用插件汇总!!!
![[ManageEngine Zhuohao] what is network operation and maintenance management and what is the use of network operation and maintenance platform](/img/a4/b1476515260e3af0ca0dcc031deb98.png)
[ManageEngine Zhuohao] what is network operation and maintenance management and what is the use of network operation and maintenance platform

Embedded system

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

C language course design student information management system (big homework)

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

ESP32深度睡眠电流怎样低于10uA

问题:OfficeException: failed to start and connect(三)
![[enterprise data security] upgrade backup strategy to ensure enterprise data security](/img/59/e44c6533aa546e8854ef434aa64113.png)
[enterprise data security] upgrade backup strategy to ensure enterprise data security
随机推荐
自开发软件NoiseCreater1.1版本免费试用
NOC 设计的一些坑
Terminology description in the field of software engineering
问题:OfficeException: failed to start and connect(三)
MySQL constraint learning notes
PAT (Advanced Level) Practice 1057 Stack
Lxml module (data extraction)
The code generator has eliminated the styling of xxxx js as it exceeds the max of 500kb
Camouflage request header Library: Anti useragent
【Unity Shader 描边效果_案例分享第一篇】
TCL statements in SQL (transaction control statements)
Postgraduate entrance examination directory link
Chapter V input / output (i/o) management
【微信小程序低代码开发】二,在实操中化解小程序的代码组成
Three minutes to quickly understand the whole process of website development
H5 web page determines whether an app is installed. If it is installed, it will jump to the summary of the scheme to download if it is not installed
[enterprise data security] upgrade backup strategy to ensure enterprise data security
[ManageEngine Zhuohao] what is network operation and maintenance management and what is the use of network operation and maintenance platform
SQL statement
(上)苹果有开源,但又怎样呢?