JQuery prevents clicking double-click multiple times to submit and pass dynamic functions or multiple parameters _ jquery

Source: Internet
Author: User
This article mainly introduces jQuery's method of preventing multiple click double-click submissions and passing dynamic functions, for more information about JQ double-click events, refer to the section on preventing multiple submissions. You can use functions to define them in batches to improve the accessibility, events that dynamically bind elements 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 ). A Tag Element (such as p). 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:
Http://images.cnitblog.com/ I /554071/201404/010846579687197.png
The source code is as follows:

The Code is as follows:






JQuery prevents multiple click double-click operations and transmits dynamic Functions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.