jquery - How can I measure the time between click and release in javascript? -
I want to start a timer when the user clicks on the object, and then pausing it when the user releases the click
The following should start with you using all javascript / jquery
Var start_time; Start function () {start_time = new date (); } Function End () {var now = new date (); Warning (now start_time); } $ ('# Element_id'). Mosudown (Start); $ ('# Element_id') mouseup (end).
The Masudown event will run the start function which sets the start time. The mouseup event will reduce the start time from the current time. The result is in millisecond
Comments
Post a Comment