Javascript/jquery Function to detect mousemovement

Hi,

I want to create a function that captures mouse movement over an object.
The idea is for part of a game whereby the user has to move the mouse up and down a certain number of times. So I need to tally this up so that I know when the user has completed.

Any ideas? And also best for performance
Thanks
coolispaulAsked:
Who is Participating?
 
Sar1973Commented:
You could use the onmousemove event, assigning it to the whole body of your page (see http://www.w3schools.com/jsref/event_onmousemove.asp).
0
 
COBOLdinosaurCommented:
just use the mouse over and increment a counter:

onmouseover="cnt++;"

You will need to define cnt globally in your scripting.

Cd&
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.