In principle, do not bind a click or double-click event to the same Dom element, which may inevitably affect each other.
I encountered the following problem: a click and dblclick (jquery used) are bound to the same Dom element. In Firefox, double-click events are triggered sometimes, but sometimes they do not, conjecture may be caused by the impact of the Click Event (double-click the event under IE to trigger ). Baidu has some content: IE handles double-click events differently from other browsers
Double-click trigger event under ie:
Mousedown, mouseup, click, mouseup, dblclick
In FF:
Mousedown, mouseup, click, mousedown, mouseup, click, dblclick
However, you only need to remember a status when you click it and reset the status for a timer. If a click trigger occurs before the timer reset status, you can call the double-click event processing function.
Clickinterval = 600;
Clicked = false;
Cleartimeout (clicktimer );
Clicktimer = setTimeout (function (){
// Alert ("clicktime:" + clicktime );
Clicked = false;
// Clicktime = 0;
}, Clickinterval );
If (clicked)
// Dblclicked event
Clicked = true;
The above code has a problem under IE, because IE triggers only one clicked when double-clicking (three clicks, ie will have double-clicking effect). However, only the browser type is determined, and a double-click event is bound. Determine if jquery $. browser. MSIE is used in IE (true or false is returned)