JQuery Ready () bind () toggle () addclass () event handling (1/2)

Source: Internet
Author: User
Tags bind

jquery Ready () bind () toggle () addclass () event handling
A function of the more commonly used dynamic effects provided in jquery. You can also add Parameters: Show (Speed,[callback]) displays all matching elements in an elegant animation, and optionally triggers a callback function when the display is complete.

Ready (FN)

Code:

JS Code
$ (document). Ready (function () {
Your code here ...
});

$ (document). Ready (function () {
Your code here ...
});

Role: It can greatly improve the response speed of Web applications. By using this method, you can immediately call the function you are binding when DOM loading is ready to be read and manipulated, and 99.99% of Web page effects functions need to be executed at that moment.

Bind (TYPE,[DATA],FN)

Code:

JS Code
$ ("P"). Bind ("click", Function () {
Alert ($ (this). text ());
});

$ ("P"). Bind ("click", Function () {
Alert ($ (this). text ());
});

Function: Bind an event handler function to a specific event (like click) for each matching element. Play the role of event monitoring.

Home 1 2 last page

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.