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
WBOYOriginal
2016-05-16 17:16:191304browse

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:


Statement:
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