Official JQuery website

Source: Internet
Author: User

Official JQuery website

JQuery

JQuery is a js library that encapsulates some of our commonly used functions to facilitate our calls and improve development efficiency.

JQuery basic reference

1. Guide

2. Two Methods

$ (Document). ready (function (){})

$ (Function (){})

3. Use

Get event Source

Event

Event Handler

JQuery Selector

#,., Element ,*,,

Space,>, + ,~

: Eq (index),: lt (index),: gt (index),: first,: last,: even,: odd

[Attr], [attr = value], and [attr! = Value], [attr ^ = value], [attr $ = value], [attr * = value]

[Attr] [attr1]

. Eq (index),. parent (), children (), siblings (),. last (), first (), find ()

Conversion between DOM objects and JQuery objects

DOM-> JQuery objects: $ (document), $ (this)

JQuery-> DOM object: $ ("div") [0], $ ("div"). get (0)

. Eq (index)-Get the JQuery object

. Get (index)-obtained DOM object

JQuery chained Programming

JQuery Animation

1. Basic Animation

Show (speed, callback)

Hide (speed, callback)

2. sliding effect

Slideup (speed, callback)

Slidedown (speed, callback)

Slidetoggle (speed, callback)

3. fade in and out

FadeIn

FadeOut

FadeToggle

Fadeto (speed, opacity, fn)

Custom Animation

Animate (params, speed, easing, fn)

Stop Animation

Stop (clearQueue, gotoend) // If bool1 is true, terminate the animation immediately. Bool2 immediately finishes the animation being executed.

Style operations

1. addclass ("style name ")

2. Removeclass ("style name") // if there is no parameter, remove all styles

3. Toggleclass ("style name ")

4. Hasclass ("style name") // determines whether the style exists and returns the bool Value

Node operations

1. Insert nodes internally

Append () // Append later

AppentTo ()

Prepend () // insert forward

PrepentTo ()

2. Insert nodes externally

After () // Add a sibling Node

Insertafter () // append

Before () // Add a sibling Node

Insertbefore () // insert

3. delete a node

Remove () // Delete the selected Element

Empty () // clear the child element

4. Copy a node

Clone () // copy the node. If the parameter is true, the event will be copied.

5. Package nodes

Wrap (node) // a single package in node

WrapAll (node) // All packages in one node

6. Replace nodes

ReplaceWidth ()

Each (fn)

Each (function (index, element ){})

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.