Today, I wrote a question about the double-click event of JQ to prevent multiple submissions. In addition, the function can be defined in batches to improve the accessibility and dynamically bind element events through methods. In addition, the function name or multiple parameters can be dynamically transferred (only the function name can be called through Eval in this instance ).
We all know that in jQuery event binding, the double-click event (dblclick) is triggered twice ). It is a Tag Element (such as div). If the element is bound with a click event or a double-click event (dblclick, the double-click event (dblclick) is not triggered. When the double-click event (dblclick) is executed, two click events are triggered ).
Let's take a look at the execution sequence of click events:
Click: mousedown, mouseout, click;
Double-click: mousedown, mouseout, click, mousedown, mouseout, click, dblclick;
In the double-click event (dblclick), the first click event will be blocked for the second time. That is to say, Double click Event (dblclick) returns the result of one click event and one double click event (dblclick. Instead of double-clicking the event result and clicking the event result ).
In this case, you only need to delete the redundant click Event (click), and this problem is solved.
The effect is as follows:
The source code is as follows:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
(End)