The 4th chapter of jquery events and animations in jquery

Source: Internet
Author: User

First, the events in jquery:

1. Loading the DOM:

jquery:$ (document). Ready ();

JavaScript:window.onload ();

$ (window). Load (function () {

}) is equivalent to

Window.onload = function () {}

Shorthand method:

(1) $ (document). Ready (Functon () {})

(2) $ (). Ready (Functon () {})

(3) $ (function () {})

2. Event Binding:

Bind ();

3. Synthetic Events:

(1) hover (): Used to simulate cursor hover events.

(2) Toggle (): Used to simulate a mouse continuous click event. Another function that toggles the visible state of the element.

4. Event bubbling:

Event.stoppropagation (); Stop event bubbling

Event.preventdefault (); Block default behavior

Overwrite to:

return false;

Event Capture:

jquery does not support event capture and requires the use of Javascrip native implementations.

5. Properties of the Event object:

(1) Event.type

(2) event.stoppropagation ();

(3) Event.preventdefault ();

(4) Event.target

(5) Event.relatedtarget

(6) Event.pagex, Event.pagey

(7) Event.which

(8) Event.metakey

6. Remove Events:

Unbind ();

One ();

7. Analog Operation:

Trigger ();

    

The 4th chapter of jquery events and animations in jquery

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.