Home > Web Front-end > JS Tutorial > Get the coordinates of the cursor/mouse and the pixel coordinates of the cursor in js on the page_javascript skills

Get the coordinates of the cursor/mouse and the pixel coordinates of the cursor in js on the page_javascript skills

WBOY
Release: 2016-05-16 17:16:19
Original
1297 people have browsed it

Recently, I have developed page statistics for the website. Although I have developed it before, the functions are not very complete, so I will use some good functions this time.

For example, this time, you may ask what is the use of JS cursor/mouse coordinates on the page. There is a hotspot statistics chart in Baidu Statistics. Now you will understand clearly.

Okay, here’s the meat:
Function: Get the pixel coordinates of the cursor

Copy the code The code is as follows :







x:
y:


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template