Learn about jQuery's event dblclick and jquery event dblclick

Source: Internet
Author: User

Learn about jQuery's event dblclick and jquery event dblclick

Insus. NET has always been developed by asp.net and uses less javascript. Now we are learning asp.net mvc. jQuery is a required client language.

Don't worry, take it easy. Step by step. This exercise shows the jQuery event dblclick.

Create an Action in the controller, that is, the operation:

 

With the operation, you must have a view to support it:

 
The above function is to double-click the text box. If you double-click an empty text box, it will prompt you to enter a value. If you double-click a text box that already contains a value, it will not do anything.

Demo:

 

 


Events passed by JQUERY

Use bind and unbind.
You mean that the event processing function is the same function.
Assume function doEvent ($ this ){};

Var $ elem = $ ("# id ");
If (on ){
$ Elem. bind ("click", function (){
DoEvent ($ (this ));
});
$ Elem. unbind ("dbclick ");
} Else {
$ Elem. bind ("dbclick", function (){
DoEvent ($ (this ));
});
$ Elem. unbind ("click ");
}

In jQuery, the bind () method problem. The following code replaces the click event with dbclick. Why is it ineffective?

Dblclick
Written on the api

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.