Javascript, click, doubleclick and drag in the same element
问题 I'm in need of a function that figures out if the user is clicking, double-clicking or dragging the mouse. Since it's all happening in the same canvas using the normal events doesn't work. I found this through google: It is inadvisable to bind handlers to both the click and dblclick events for the same element. The sequence of events triggered varies from browser to browser, with some receiving two click events and others only one. If an interface that reacts differently to single- and double