DOM Operations
To manipulate related elements:
In: Children (), find ("selector")
Outside: parent (), parents ("selector")
Next: Next (), Nextall (selector)
On: Prev (), Prevall ("selector")
Attaching: Collection Operations
First (), Last (), EQ (n)
adding, copying, replacing, and removing elements
Added: Append (Element Object), Prepend (Element Object), after (element object), before (element object)
Copy: Clone ()
To remove:
Empty empty ()-preserves the outer elements and clears all elements and contents.
Remove Remove ()-Removes all elements.
Replace:
Events and animations
First, the incident
1. In JavaScript syntax, the events in the onxxxxx are removed, which is the event in jquery.
Onclick-click
Ondblclick-dblclick
Onmouseover-mouseover
Onmouseout-mouseout
Onfocus-focus
Onblur-blur
Onchange-change
Onkeydown-keydown
Onkeyup-keyup
Onkeypress-keypress
2. Unique Events:
Hover (function () {},function () {}): the equivalent of combining mouseover and mouseout
Toggle (function () {},function () {},... function () {}): Executes the next function per click, as executed to the end, and returns the first execution
Event in 3.JQuery, requires the event's parentheses to write function () {}
$ ("#Button1"). Click (function () {
Event handling code
});
Case:
1. Light Stick Effect: mouseover,mouseout
2. Expand the Panel: click
Second, the animation
Hide (), show ()
FadeIn (), FadeOut ()
Slideup (), Slidedown ()
Slideup ([Number of milliseconds],[callback function])
Slideup (3000,function () {xxx ();})
Animate ({left: "500px"},3000,function () {/* callback function */})
Stop (Bool,bool);
First argument: Whether to empty the previous animation sequence.
Second parameter: Go straight to the last state.
. netdom operation--un