Cursor Position Tracker For jQuery - Cursor Tracker

Cursor Position Tracker For jQuery - Cursor Tracker
File Size: 4.66 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A Cursor Tracker built using jQuery that keeps track of the current cursor position and angle on mouse move.

See also:

How to use it:

1. Include both jQuery library and the Cursor Tracker's script 'cursor-tracker.js' at the bottom of the webpage.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="cursor-tracker.js"></script>

2. Call the function on the target container where you want to track the cursor position.

$(".element").cursor("mousemove", function(values) {
  ...
});

3. Available attributes:

$(".element").cursor("mousemove", function(values) {

  // cursor position in relation to the center of the element
  values.xAxisCentered
  values.yAxisCentered

  // cursor position in relation to the top left of the element
  values.xAxisCentered
  values.yAxis

  // degress in relation to the center of the element
  values.angle

  // corner of the element
  values.corner
  
});

Change log:

2017-10-10


This awesome jQuery plugin is developed by tomislavjezidzic. For more Advanced Usages, please check the demo page or visit the official website.