
JQUERY 1.3 VISUAL CHEAT SHEET ★ SELECTORS ★ CORE ★ ATTRIBUTES ★ TRAVERSING ★ MANIPULATION ★ CSS ★ EVENTS ★ EFFECTS ★ AJAX ★ UTILITIES ★ ★ SELECTORS / 5. ATTRIBUTE FILTERS ★ LEGEND C SELECTORS / 3. BASIC FILTERS SELECTORS / 7. VISIBILITY FILTERS El Element a<> Array :first :hidden a<El> [attribute] a<El(s)> a<i> Array of i Matches the first selected element. a<El(s)> Matches all elements that are hidden. Fx Function Matches elements that have the specified attribute. a<i(s)> Array of i (s) Num Number T Notes :last :visible Int Integer a<El> a<El(s)> Deprecated in Matches the last selected element. [attribute=value] Matches all elements that are visible. 0-1 Boolean ✽ jQuery 1.3 Matches elements that have the specified attribute a<El(s)> :not(selector) with a certain value. Designed by Antonio Lupetti Filters out all elements matching the given a<El(s)> • http://woork.blogspot.com • http://www.twitter.com/woork selector. [attribute!=value] ★ SELECTORS / 8. FORMS Matches elements that either don't have the a<El(s)> :even specified attribute or do have the specified a<El(s)> :input Matches even elements, zero-indexed. attribute but not with a certain value. ★ SELECTORS / 1. BASIC Matches all input, textarea, select and button a<El(s)> elements. #id :odd [attribute^=value] a<El(s)> :text Matches a single element with the given id a<El> Matches odd elements, zero-indexed. Matches elements that have the specified attribute a<El(s)> a<El(s)> attribute. and it starts with a certain value. Matches all input elements of type text. :password element :eq(index) a<El(s)> a<El(s)> a<El> [attribute$=value] Matches all input elements of type password. Matches all elements with the given name. Matches a single element by its index. Matches elements that have the specified attribute a<El(s)> :radio and it ends with a certain value. a<El(s)> :gt(index) Matches all input elements of type radio. .class a<El(s)> Matches all elements with an index above the a<El(s)> Matches all elements with the given class. :checkbox given one. a<El(s)> [attribute*=value] Matches all input elements of type checkbox. Matches elements that have the specified attribute a<El(s)> .class.class :lt(index) and it contains a certain value. :submit a<El(s)> Matches all elements with an index below the a<El(s)> a<El(s)> Matches all elements with the given classes. Matches all input elements of type submit. given one. [attributeFilter1][attributeFilter2] :image :header a<El(s)> * [attributeFilterN] Matches all input elements of type image. a<El(s)> a<El(s)> a<El(s)> Matches all elements. Matches all elements that are headers, like h1, Matches elements that match all of the specified h2, h3 and so on. :reset attribute filters. a<El(s)> Matches all input elements of type reset. selector1, selector2, selectorN :animated a<El(s)> Matches the combined results of all the specified Matches all elements that are currently being a<El(s)> :button selectors. animated. Matches all button elements and input elements a<El(s)> of type button ★ SELECTORS / 6. CHILD FILTERS :file a<El(s)> Matches all input elements of type file. ★ SELECTORS / 2. HIERARCHY :nth-child(index/even/odd/equation) ★ SELECTORS / 4. CONTENT FILTERS Matches all elements that are the nth-child of their a<El(s)> parent or that are the parent's even or odd ancestor descendant children. a<El(s)> :contains(text) Matches all descendant elements specified by a<El(s)> ★ SELECTORS / 9. FORM FILTERS "descendant" of elements specified by "ancestor". Matches elements which contain the given text. :first-child Matches all elements that are the first child of their a<El(s)> :enabled parent > child :empty a<El(s)> a<El(s)> parent. Matches all child elements specified by "child" of Matches all elements that have no children a<El(s)> Matches all elements that are enabled. elements specified by "parent. (including text nodes). :disabled :last-child a<El(s)> Matches all elements that are disabled. prev + next :has(selector) Matches all elements that are the last child of their a<El(s)> Matches all next elements specified by "next" that a<El(s)> Matches elements which contain at least one a<El(s)> parent. are next to elements specified by "prev". element that matches the specified selector. :checked a<El(s)> Matches all elements that are checked. prev ~ siblings :parent :only-child Matches all elements that are parents - they have a<El(s)> Matches all elements that are the only child of a<El(s)> :selected Matches all sibling elements after the "prev" a<El(s)> a<El(s)> element that match the filtering "siblings" selector. child elements, including text. their parent. Matches all elements that are selected. JQUERY 1.3 VISUAL CHEAT SHEET ★ SELECTORS ★ CORE ★ ATTRIBUTES ★ TRAVERSING ★ MANIPULATION ★ CSS ★ EVENTS ★ EFFECTS ★ AJAX ★ UTILITIES ★ CORE / 1. THE JQUERY FUNCTION ★ CORE / 3. DATA ★ ATTRIBUTES / 1. ATTR ★ ATTRIBUTES / 3. HTML jQuery( expression, context ) data( name ) attr( name ) html( ) Any This function accepts a string containing a CSS jQuery Returns value at named data store for the Access a property on the first matched element. Get the html contents (innerHTML) of the first selector which is then used to match a set of element, as set by data(name, value). This method makes it easy to retrieve a matched element. This property is not available elements. property value from the first matched element. on XML documents (although it will work for XHTML documents). If the element does not have an attribute with Object data( name, value ) T How to use: String jQuery( html, ownerDocument ) jQuery such a name, undefined is returned. Stores the value in the named spot. $("p").click(function () { Create DOM elements on-the-fly from the jQuery Attributes include title, alt, src, href, width, var htmlStr = $(this).html(); provided String of raw HTML. T style, etc. $(this).text(htmlStr); removeData( name ) }); jQuery jQuery( elements ) Removes named data store from an element. jQuery attr( properties ) Wrap jQuery functionality around a single or an html( val ) array of DOM Element(s) . Set a key/value object as properties to all jQuery matched elements. Set the html contents of every matched element. queue( name ) This property is not available on XML documents (although it will work for XHTML a<F > jQuery( callback ) Returns a reference to the first element's queue x documents). jQuery (which is an array of functions). A shorthand for $(document).ready(). attr( key, value ) jQuery Set a single property to a value, on all matched jQuery T How to use: elements. $("div").html(" queue( name, callback ) <span class='red'>Hello Adds a new function, to be executed, onto the jQuery end of the queue of all matched elements. attr( key, fn ) <b>Again</b></span>"); ★ CORE / 2. OBJECT ACCESSORS Set a single property to a computed value, on all jQuery matched elements. each( callback ) queue( name, queue ) jQuery Replaces the queue of all matched element with jQuery Execute a function within the context of every ★ ATTRIBUTES / 4. TEXT matched element. this new queue (the array of functions). removeAttr( name ) Remove an attribute from each of the matched jQuery elements. size( ) text( ) Num dequeue( name ) Get the combined text contents of all matched The number of elements in the jQuery object. Removes a queued function from the front of the jQuery elements. queue and executes it. String length T How to use: Num ★ ATTRIBUTES / 2. CLASS The number of elements in the jQuery object. var str = $("p:first").text(); $("p:last").html(str); selector ★ CORE / 4. PLUGIN addClass( class ) A selector representing selector originally passed String Adds the specified class(es) to each of the set of jQuery to jQuery(). text( val ) matched elements. jQuery jQuery.fn.extend( object ) Set the text contents of all matched elements. context Extends the jQuery element set to provide new jQuery The DOM node context originally passed to jQuery El methods (used to make a typical jQuery plugin). hasClass( class ) () (if none was passed then context will be equal to 0-1 the document). Returns true if the specified class is present on at least one of the set of matched elements. jQuery.extend( object ) eq( position ) jQuery ★ ATTRIBUTES / 5. VALUE Extends the jQuery object itself. Reduce the set of matched elements to a single jQuery element. removeClass( class ) val( ) Removes all or the specified class(es) from the jQuery get( ) set of matched elements. Get the input value of the first matched element. a<El> Access all matched DOM elements. ★ CORE / 5. INTEROPERABILITY T How to use: $("input").keyup(function () { String | a<> get( index ) toggleClass( class ) jQuery var value = $(this).val(); Access a single matched DOM element at a El Adds the specified class if it is not present, jQuery.noConflict( ) $("p").text(value); specified index in the matched set. removes the specified class if it is present. Run this function to give control of the $ variable jQuery }).keyup(); back to whichever library first implemented it. index( subject ) Searches every matched element for the object and toggleClass( class, switch ) val( val ) returns the index of the element, if found, starting Num jQuery.noConflict( extreme ) Adds the specified class if the switch is true, jQuery Set the text contents of all matched elements. jQuery with zero. If a jQuery object is passed, only the Extends the jQuery object itself. Use with jQuery removes the specified class if the switch is false. Checks, or selects, all the radio buttons, first element is checked. discretion. checkboxes, and select options that match the set of values. JQUERY 1.3 VISUAL CHEAT SHEET ★ SELECTORS ★ CORE ★ ATTRIBUTES ★ TRAVERSING ★ MANIPULATION ★ CSS ★ EVENTS ★ EFFECTS ★ AJAX ★ UTILITIES ★ TRAVERSING / 1.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-