JSP page click the double tap event to differentiate

Source: Internet
Author: User

Click the order in which the events are executed:
click: Mousedown,mouseout,click;
Double-click (DblClick): Mousedown,mouseout,click, Mousedown,mouseout,click,dblclick;
in a double-click event (DblClick), the two-click event that is triggered (clicking), the first click event is masked out, but not the second time. That is, a double-click event (DblClick) Returns the result of a single clicking event and a double click event (DblClick). Instead of a double-click event (DblClick) result and two click event Results (clicks).
In this case, the problem is solved by simply eliminating the extra click event.

Specific code:

var timefunction = null;


function Click () {

Cancels the method that was not executed last time delay

Cleartimeout (timefunction);

Execution delay

timefunction = setTimeout (function () {

Do function writes the code here to execute the Click event

Alert ("click");

},1000);

});


function Dbclick () {

Cancels the method that was not executed last time delay

Cleartimeout (timefunction);

Double-click the execution code of the event

Alert ("Double-click");

})



JSP page click the double tap event to differentiate

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.