How to get the starting time of a mousemove event in javascript/jquery?

Go To StackoverFlow.com

0

Is there any attibute associated with the starting time I can get from the 'event' parameter in the callback function of a mousemove event?

2012-04-04 03:16
by chaonextdoor


0

This code will store time (as timestamp) when mousemove happend first within a element:

 var startTime = null;
    $('<YOUR_ELEMENT>').one('mousemove', function(e) {
        startTime = e.timeStamp;
        console.log(startTime);
    });
2012-04-04 03:34
by thecodeparadox


1

Have you tried event.timeStamp?

Returns the time (in milliseconds since the epoch) at which the event was created.

2012-04-04 03:21
by P. Galbraith
When suggesting a javascript feature, it's much better to link to the appropriate standard which is the definitive reference. Links to other locations (e.g MSDN and MDN) can be used for examples or proprietary features that either aren't in standards or are implemented differently to the standard - RobG 2012-04-04 03:42
Ads