"Sharp jquery" Reading notes

Source: Internet
Author: User

jquery Concept: Write less, do more! 

Chapter I.
One: Introduction to jquery
A: Lightweight
B: Powerful selector
C:dom Package
D:ajax Package
e: Do not pollute top-level variables create only one jquery object: All methods are under this object!
f: Resolves browser compatibility issues
g: Separation of behavior and structure
h: a rich plugin

II: The configuration of the language environment
A: You can import it in the page!

Three: jquery objects and Dom objects
jquery Object--"DOM object: Treat jquery objects as an array!
DOM Object--"jquery object: $ (DOM object) packaging can be
$ (): jquery object's manufacturing plant


Chapter II jquery selector

Four: selector (the heavy weight of jquery) Super NB
A:css selector finds element add style, jquery selector finds element add behavior!
B: The CSS selector used in jquery has cross-browser compatibility!
C: Filter selector
1. Basic Filter Selector
2. Content Filter Selector
3. Visibility Filter Selector
4. Attribute Filter Selector
5. Child element Filter Selector
6. Form object property Filter Selector

Five: $ (' #id \ #b ')//Escape special Characters "#"

VI: The href attribute jump of a tag can be overwritten with jquery! This means that jquery performs a higher priority than the default href attribute of a tag!

Seven: jquery selector can be extended! Add Plugins to jquery!


Chapter III DOM manipulation in jquery

Eight: DOM
A: Is a browser, platform, language-independent interface.
B: Divided into DOM Core, Html-dom, Css-dom
C: Node: Document node, element node, text node, attribute node, comment node
DOM Operations
A: Add the node first, and then insert the node.
Clone () Copy the node and insert it again! To copy the event that the node has the original node (the Clone () method parameter writes true).
B: Delete the Remove () method, Empty () method
C: Replace package move
d: Check
f: Replace ReplaceWith () replaceall ()
g: Wrap Wrap () Wrapall () Wrapinner ( )
F: Property settings, GET, delete attr () attr (",") removeattr (");
H: Operation of the Style addclass () removeclass () Toggleclass () hasclass ( )
i:html () text () Val ( )
J: Traverse Children () Next () prev () siblings () closest ()

Css-dom
a:css () offset () position () scrolltop () scrollleft () (need to be strengthened here)


Chapter fourth events and animations in jquery

1. Synthesis Event: hover () toggle ()
2. Bubbling and capturing
(3). Event Object Properties: Event.type Event.preventdefault () event.stoppropagation ()
event.target Event.pagex event.pagey Event.which
4.bind () unbind () one ()
5. Simulation operation: Direct activation of the event $ (' element '). Trigger (' event name ')
$ (' element '). Click ()
6. Trigger the custom event:
<script>
$ (' #btn '). Bind (' Myclick ', function () {
$ (' #test '). Append (' <p> my custom events </p> ');
})
$ (' #btn '). Trigger (' Myclick '); Trigger this event
</script>



fifth. jquery's operations on forms and forms

1.is (": Animated") determines whether it is in the animation queue. jquery is all about jquery objects!

2.each () and each (i)


"Sharp jquery" Reading notes

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.