Skip to content

EvanHahn/MouseTracker.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mouse tracker dot js

where's the mouse at?

var mouse = mouseTracker();

now mouse.x and mouse.y stay updated! they're initially set to null.

that's basically it!

you can also set what element to bind to.

var mouse = mouseTracker({
  element: document.querySelector('canvas')
});

if you don't like that the starting values being null:

var mouse = mouseTracker({
  startX: 100,
  startY: 200
});

About

keep mouse.x and mouse.y updated

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published