jQuery mouse tracker snippet
March 27, 2010 | Posted in jQuery | Tags: code, demo, javascript, jQuery, learning, mouse, mousemove, snippet, webdev | 1 comment
While I was doing some script work for a client, I came across the nifty jQuery mousemove property. As this tutorial explains, you can bind the “on mouse move” event and track the pointer position as it moves across the screen. Note: This requires jQuery 1.3. The latest version of jQuery apparently doesn’t work!
This was perfect for designing my nav button slider, in which the button needs to slide along with the pointer. I only got the basic follow mouse function so far, but it’s still pretty neat.
View Demo
Here’s the code:
