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

边栏推荐
- node中引入模块的原理
- Gson的@JsonAdater注解的几种方式
- SQL learning notes 2
- Application of IT service management (ITSM) in Higher Education
- What is a port scanning tool? What is the use of port scanning tools
- Docker 安装部署Redis
- 第五章 輸入/輸出(I/O)管理
- [unity shader ablation effect _ case sharing]
- SQL中DML语句(数据操作语言)
- Find the original array for the inverse logarithm
猜你喜欢
![[wechat applet] how to build a building block development?](/img/69/edb02c88b52b474a797307b96de369.jpg)
[wechat applet] how to build a building block development?

C语言课设图书信息管理系统(大作业)

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

Embedded system

ESP32在电池供电时用ULP监测电池电压

Application of IT service management (ITSM) in Higher Education

Redis安装到Windows系统上的详细步骤
![[unity shader stroke effect _ case sharing first]](/img/bd/5cd1bef24e6b6378854114c2c05bd9.png)
[unity shader stroke effect _ case sharing first]

Free trial of self-developed software noisecreater1.1

async 与 await
随机推荐
SQL learning notes 2
[ManageEngine Zhuohao] mobile terminal management solution, helping the digital transformation of Zhongzhou aviation industry
[ManageEngine Zhuohao] what is network operation and maintenance management and what is the use of network operation and maintenance platform
The code generator has eliminated the styling of xxxx js as it exceeds the max of 500kb
Idea easy to use plug-in summary!!!
Async and await
mysql学习
C how to print out the original array
(上)苹果有开源,但又怎样呢?
Design of sales management system for C language course (big homework)
What are the functions of LAN monitoring software
json模块
ESP32 ESP-IDF GPIO按键中断响应
【#Unity Shader#自定义材质面板_第一篇】
If I am in Guangzhou, where can I open an account? Is it safe to open an account online?
HW(OD)岗面试题
[ManageEngine Zhuohao] use unified terminal management to help "Eurex group" digital transformation
Redis安装到Windows系统上的详细步骤
SQL语句
async 与 await