The behavior of the dblclick
event is explained at Quirksmode.
The order of events for a dblclick
is:
- mousedown
- mouseup
- click
- mousedown
- mouseup
- click
- dblclick
The one exception to this rule is (of course) Internet Explorer with their custom order of:
- mousedown
- mouseup
- click
- mouseup
- dblclick
As you can see, listening to both events together on the same element will result in extra calls to your click
handler.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…