Hi, I'm pretty new to javascript. I want to be able to fire an event when the user clicks on a point in the canvas (short press), and if he holds it by clicking on 1500 ms, I have to have different functionality. I have to admit the long press before the mouse is finished.
For ex:
el.addEventListener("mousedown", doMouseDown, false); el.addEventListener("mouseup", update, false);
function doMouseDown()
{
if (short press)
functionality of shortpress
if (longpress)
functionality of long press
}
function update()
//do some update of coordinates
source
share