jquery effect and element selection
// element selected $ ( the this ) .hide (); $ ( " p.test " ) // hide all class = "test" the <p> element $ ( " P: First " ) // Select the first < p> element $ ( " a [target = '_ blank'] " ) /// select all the target attribute value is equal to "_bLank" of <a> element // document ready event $ (document) .ready (function () { / / ......... }) // jQuery event $ ( " the p- " ). the Click (function () { // execute code }); // jQuery Hide / Show $ ( " the p- " ) .hide (Speed); // speed $ ( " P " ) .Show (Speed); $ (Selector) .hide (Speed, callback); // You can add a callback function $ (Selector) .toggle (Speed, the callback); // switch between the two methods // fade $ (Selector) .fadeIn (Speed, the callback); $ (Selector) .fadeOut (Speed, the callback); $ ( Selector) .fadeToggle (Speed, the callback); $ (Selector) .fadeTo (Speed, opacity, the callback); // allow gradient for a given opacity // slide $ (Selector) .slideDown (Speed, the callback); / /The optional speed parameter specifies the duration of the effect. It can take the following values: "slow", "fast" or milliseconds. // optional callback parameter is the name of the function executed after completion of the slide. $ (Selector) .slideDown (Speed, the callback); $ (Selector) .slideUp (Speed, the callback); $ (Selector) .slideToggle (Speed, the callback); // animation $ (Selector) .animate ({ the params }, Speed, the callback); // when using Animate (), Camel notation must write all attribute name = e.g. left-padding> the paddingLeft // the jQuery sTOP () or a method for stopping an animation effect, until they complete. Capture content text () html () val ( ) value of the property $ (Selector) .attr ( "href", " http://www.com "); add new content $ ( "p") append ( . "append text") $ ( " append / prepend is inside a selection element is embedded after / before appending the outside element jQuery remove () to delete selected elements, including sub-elements empty () to delete the selected elements subelements disposed css attributes css ({ "propertyname": " value "," propertyname ":" value ", ...});
jquery traversal