JQuery Bind event Usage detailed _jquery

Source: Internet
Author: User
Using jquery for nearly 1 years now, looking at foreign cattle code suddenly found a place did not see the code as follows

$ (window). bind (' Load.jcarousel ', function () {windowloaded = true;});

Perhaps I don't know much about jquery, I have read a jquery primer, and then always learn in the work, touch the problem to sum up, learn a little ... Hey, maybe why the company recruitment is more than 1 years of work experience or something, the actual combat is to enable people to improve the fastest.

Find the jquery API, as explained below:

1. One time you can bind multiple events. Such as:
Copy Code code as follows:

$ (' #foo '). Bind ({
Click:function () {
Do something on click
},
Mouseenter:function () {
Do something on MouseEnter
}
});

2. Any string that is a parameter of type is legitimate, and if a string is not a native JavaScript event name, then the event handler is bound to a custom event. These custom events are never triggered by the browser, but can be manually triggered in other code by using the. trigger () or. Triggerhandler ().

3. If the string of the type parameter contains a point (.) Character, this event is considered a namespace. This dot character is used to separate the event from his namespace. Such as:

$obj. Bind (' Click.name ', handler) the click in the string is the event type, and the string name is the namespace.

All right, that's it, come home from work. Summarize a model of jquery development this month and be prepared for it. Finally, I hope this article will help you.

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.