Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shoaib-fateh/mouse-tracker
This project is a simple yet effective mouse tracker implemented in JavaScript. It tracks the movement of the mouse cursor across the webpage and displays the X and Y coordinates in real-time.
https://github.com/shoaib-fateh/mouse-tracker
Last synced: about 1 month ago
JSON representation
This project is a simple yet effective mouse tracker implemented in JavaScript. It tracks the movement of the mouse cursor across the webpage and displays the X and Y coordinates in real-time.
- Host: GitHub
- URL: https://github.com/shoaib-fateh/mouse-tracker
- Owner: shoaib-fateh
- Created: 2022-10-18T10:03:28.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-14T10:29:05.000Z (about 1 year ago)
- Last Synced: 2023-10-15T20:43:08.137Z (about 1 year ago)
- Language: CSS
- Homepage:
- Size: 331 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mouse Tracker
This project is a simple yet effective mouse tracker implemented in JavaScript. It tracks the movement of the mouse cursor across the webpage and displays the X and Y coordinates in real-time.
## How it works
The script uses the `mousemove` event listener on the entire HTML document to track the cursor's movement. It then updates the position of two lines (one vertical and one horizontal) that intersect at the cursor's current position. The X and Y coordinates of the cursor are also displayed on the page, following the cursor as it moves.
## How to use
To use this script, simply include it in your HTML file and ensure that you have elements with the IDs `line_X`, `line_Y`, and `XYcoordinates`, and classes `Xcoordinates` and `Ycoordinates` in your HTML. These elements will be used to display the lines and coordinates.