$ (this). Hide ()
Demonstrates the Hide () function of JQuery, hiding the current HTML element.
$ ("P"). Hide ()
Demonstrates the Hide () function of jQuery, hiding all <p> elements.
$ (". Test"). Hide ()
Demonstrates the Hide () function of jQuery, hiding all elements of the class= "test".
$ ("#test"). Hide ()
Demonstrates JQuery's hide () function, which hides elements of the id= "test".
$ ("[href]") selects all elements with an href attribute.
$ ("[href= ' # ']") selects all elements with an HREF value equal to "#".
$ ("[href!= ' # ']") selects all elements with an HREF value that is not equal to "#".
$ ("[href$= '. jpg ']") selects all elements with an href value ending with ". jpg".
JQuery CSS Selector
The JQuery CSS selector can be used to change the CSS properties of HTML elements.
The following example changes the background color of all p elements to red:
Instance
$ ("P"). CSS ("Background-color", "Red");
$ (this) current HTML element
$ ("P") all <p> elements
$ ("P.intro") <p> elements for all class= "Intro"
$ (". Intro") All Elements of class= "Intro"
$ ("#intro") id= Elements of "Intro"
$ ("ul Li:first") the first <li> element of each <ul>
$ ("[href$= '. jpg ']") all href attributes with attribute values ending with ". jpg"
$ ("Div#intro. Head") id= all class= "head" elements in the <div> element of "Intro"
jquery Events
Here are some examples of the event methods in JQuery:
The Event function binds the function to the
$ (document). Ready (function) binds functions to a document's readiness event (when the document finishes loading)
$ (selector). Click to trigger or bind a function to a clicked event of the selected element
$ (selector). DblClick (function) triggers or binds a function to a double-click event of the selected element
$ (selector). focus (function) triggers or binds a function to the Focusable event of the selected element
$ (selector). mouseover (function) triggers or binds a function to a mouse hover event of the selected element
JQuery Fading Method
FadeIn ()//for fading in hidden elements
FadeOut ()//for fading out visible elements
Fadetoggle ()//fadein () and fadeout (), the parentheses can add time to show and hide the speed;
The FadeTo ()//method allows the gradient to be given opacity (values between 0 and 1).
jquery Swipe
The Slidedown () method is used to slide the element down. $ (selector). Slidedown (Speed,callback);
The Slideup () method is used to slide the element up. Syntax: $ (selector). Slideup (Speed,callback);
Slidetoggle () Toggles between the Slidedown () and the Slideup () method. $ (selector). Slidetoggle (Speed,callback);
Animate custom Animations
Get Property-attr ()
jquery basic Syntax