Skip to content

Instantly share code, notes, and snippets.

@anteprimorac
Created January 23, 2015 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anteprimorac/3206009010122d729d73 to your computer and use it in GitHub Desktop.
Save anteprimorac/3206009010122d729d73 to your computer and use it in GitHub Desktop.
;( function( $ ) {
var mouse = {
x: 0, // Current x-axis position of mouse
y: 0 // Current y-axis position of mouse
};
$( document ).on( 'mousemove', function( event ) {
mouse.x = event.clientX || event.pageX;
mouse.y = event.clientY || event.pageY;
} );
} ) ( jQuery )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment