JavaScript Library To Track Mouse Position Relative To Element – spot.js

Category: Javascript , Recommended | May 4, 2016
Authorbrainlessdeveloper
Last UpdateMay 4, 2016
LicenseMIT
Tags
Views776 views
JavaScript Library To Track Mouse Position Relative To Element – spot.js

spot.js a lightweight JavaScript library that tracks your mouse position and adds the corresponding effects to target element.

How to use it:

Just download and include the spot.js script in the html document and we’re ready to go.

<script src="spot.js"></script>

Add the following CSS classes to your element.

  • spot-shadow: create dynamic shadows relative to the mouse position.
  • spot-rotate: rotate an element to face wherever the mouse is.
  • spot-area: restrict where spot.js will listen to mouse move events.

You Might Be Interested In:


Leave a Reply