jQuery-1.6-Visual-Cheat-Sheet.pdf

(347 KB) Pobierz
jQUERY 1.6
VISUAL CHEAT SHEET
SELECTORS ✼ CORE ✼ ATTRIBUTES ✼ CSS ✼ TRAVERSING ✼ MANIPULATION ✼ EVENTS ✼ EFFECTS ✼ AJAX ✼ UTILITIES ✼ DEFERRED OBJECT
Designed by Antonio Lupetti © 2011 • http://woorkup.com • http://twitter.com/woork | jQuery is © of John Resig and the jQuery Team.
˒ = NEW IN jQUERY 1.6 / f(x) = FUNCTION / a = ARRAY / jQ = jQUERY / El = ELEMENT / 0-1 = BOOLEAN / Obj = OBJECT / NUM = NUMBER / Str = STRING
:header Selector
Selects all elements that are headers, like
h1, h2, h3 and so on.
[name!=value]
Select elements that either don't have the
specified attribute, or do have the specified
attribute but not with a certain value.
:file Selector
Selects all elements of type file.
.get( [ index ] )
Retrieve the DOM elements matched by the
jQuery object.
SELECTORS / 1. BASIC
a <El( s )>
a <El( s )>
El | a
a <El( s )>
All Selector (“*”)
Selects all elements.
<El( s )>
:image Selector
Selects all elements of type image.
a <El( s )>
.index()
Search for a given element from among the
matched elements.
Selects the last matched element.
a <El>
[name^=value]
Selects elements that have the specified
attribute with a value beginning exactly
with a given string.
Class Selector (“.class”)
Matches all elements with the given name.
Num
a <El( s )>
:input Selector
Selects all input, textarea, select and button
elements.
a <El( s )>
:lt() Selector
Select all elements at an index less than
index within the matched set.
a <El( s )>
.length
The number of elements in the jQuery object.
Selects all elements with the given tag
name.
a <El( s )>
Num
a <El( s )>
[name]
Selects elements that have the specified
attribute, with any value.
:password Selector
Selects all elements of type password.
a <El( s )>
a <El( s )>
.selector
A selector representing selector originally
passed to jQuery().
:not() Selector
Selects all elements that do not match the
given selector.
Str
ID Selector (“#id”)
Selects a single element with the given id
attribute.
a <El( s )>
:radio Selector
Selects all elements of type radio.
a <El>
a <El( s )>
[name=value][name2=value2]
Matches elements that match all of the
specified attribute filters.
a <El( s )>
.size()
Return the number of DOM elements matched
by the jQuery object.
:odd Selector
Selects odd elements, zero-indexed. See
also even.
Selects the combined results of all the
specified selectors.
:reset Selector
Selects all elements of type reset.
Num
a <El( s )>
a <El( s )>
a <El( s )>
SELECTORS / 6. CHILD FILTER
.toArray()
Retrieve all the DOM elements contained in the
jQuery set, as an array.
:selected Selector
Selects all elements that are selected.
a <El( s )>
SELECTORS / 4. CONTENT FILTER
SELECTORS / 4. CONTENT FILTER
a
:first-child Selector
Selects all elements that are the first child
of their parent.
a <El( s )>
:contains() Selector
Select all elements that contain the
specified text.
SELECTORS / 2. HIERARCHY
:submit Selector
Selects all elements of type submit.
a <El( s )>
a <El( s )>
CORE / 3. DATA
Child Selector (“parent > child”)
Selects all direct child elements specified by
"child" of elements specified by "parent".
:last-child Selector
Selects all elements that are the last child of
their parent.
:text Selector
Selects all elements of type text.
a <El( s )>
a <El( s )>
a <El( s )>
.queue( [ queueName ] , newQueue )
Show the queue of functions to be executed on
the matched elements.
:empty Selector
Select all elements that have no children
(including text nodes).
jQ
a <El( s )>
Descendant Selector (“ancestor
descendant”)
Selects all elements that are descendants of
a given ancestor.
:nth-child Selector
Selects all elements that are the nth-child of
their parent.
CORE / 1. THE jQUERY FUNCTION
CORE / 1. THE jQUERY FUNCTION
a <El( s )>
.data( obj )
Store arbitrary data associated with the
matched elements.
a <El( s )>
:has() Selector
Selects elements which contain at least one
element that matches the specified selector.
jQ
a <El( s )>
jQuery()
Accepts a string containing a CSS selector
which is then used to match a set of
elements.
:only-child Selector
Selects all elements that are the only child
of their parent.
jQ
Next Adjacent Selector (“prev +
next”)
Selects all next elements matching "next"
that are immediately preceded by a sibling
"prev".
a <El( s )>
.removeData( [ name ] )
Remove a previously-stored piece of data.
:parent Selector
Select all elements that are the parent of
another element, including text nodes.
jQ
a <El( s )>
a <El( s )>
jQuery.sub()
Creates a new copy of jQ whose properties
and methods can be modified without
affecting the original jQuery object.
.dequeue( [ queueName ] )
Execute the next function on the queue for the
matched elements.
SELECTORS / 7. VISIBILITY FILTER
SELECTORS / 7. VISIBILITY FILTER
jQ
jQ
SELECTORS / 5. ATTRIBUTE
Next Siblings Selector (“prev ~
siblings”)
Selects all sibling elements that follow after
the "prev" element, have the same parent,
and match the filtering "siblings" selector.
:hidden Selector
Selects all elements that are hidden.
a <El( s )>
jQuery.when()
Provides a way to execute callback functions
based on one or more objects, usually
Deferred objects that represent
asynchronous events.
[name|=value]
Selects elements that have the specified
attribute with a value either equal to a
given string or starting with that string
followed by a hyphen (-).
a <El( s )>
CORE / 4. INTEROPERABILITY
:visible Selector
Selects all elements that are visible.
Deferred
a <El( s )>
a <El( s )>
jQuery.fn.extend( object )
Extends the jQuery element set to provide new
methods (used to make a typical jQuery
plugin).
jQ
jQuery.noConflict( )
Relinquish jQuery's control of the $
variable.
SELECTORS / 3. BASIC FILTER
[name*=value]
Selects elements that have the specified
attribute with a value containing the a
given substring.
SELECTORS / 8. FORM
Obj
a <El( s )>
:animated Selector
Select all elements that are in the progress
of an animation at the time the selector is
run.
:button Selector
Selects all button elements and elements of
type button.
jQuery.extend( object )
Extends the jQuery object itself.
jQ
a <El( s )>
a <El( s )>
jQuery.holdReady() ˒
Holds or releases the execution of jQuery's
ready event.
[name~=value]
Selects elements that have the specified
attribute with a value containing a given
word, delimited by spaces.
0-1
:checkbox Selector
Selects all elements of type checkbox.
ATTRIBUTES / 1. ATTR
a <El( s )>
a <El( s )>
Select the element at index n within the
matched set.
a <El>
.attr( attributeName )
Get the value of an attribute for the first
element in the set of matched elements.
jQuery.extend( object )
Extends the jQuery object itself.
jQ
:checked Selector
Matches all elements that are checked.
Str
a <El( s )>
[name$=value]
Selects elements that have the specified
attribute with a value ending exactly with
a given string.
Selects even elements, zero-indexed
a <El( s )>
a <El( s )>
:disabled Selector
Selects all elements that are disabled.
.attr( attributeName , value )
Set one or more attributes for the set of
matched elements.
CORE / 2. OBJECT ACCESSORS
a <El( s )>
Obj
:first Selector
Selects the first matched element.
.context
The DOM node context originally passed to
jQuery().
a <El>
[name=value]
Selects elements that have the specified
attribute with a value exactly equal to a
certain value.
:enabled Selector
Selects all elements that are enabled.
El
a <El( s )>
.removeAttr()
Remove an attribute from each element in the
set of matched elements.
a <El( s )>
:gt() Selector
Select all elements at an index greater than
index within the matched set.
jQ
a <El( s )>
.each( function(index , Element) )
Iterate over a jQ object, executing a function
for each matched element.
:focus selector ˒
Selects element if it is currently focused.
a <El( s )>
jQ
905438531.259.png 905438531.270.png 905438531.281.png 905438531.292.png 905438531.001.png 905438531.012.png 905438531.023.png 905438531.034.png 905438531.045.png 905438531.056.png 905438531.067.png 905438531.078.png 905438531.089.png 905438531.100.png 905438531.111.png 905438531.122.png 905438531.133.png 905438531.144.png 905438531.155.png 905438531.166.png 905438531.177.png 905438531.188.png 905438531.199.png 905438531.210.png 905438531.221.png 905438531.230.png 905438531.231.png 905438531.232.png 905438531.233.png 905438531.234.png 905438531.235.png 905438531.236.png 905438531.237.png 905438531.238.png 905438531.239.png 905438531.240.png 905438531.241.png 905438531.242.png 905438531.243.png 905438531.244.png 905438531.245.png 905438531.246.png 905438531.247.png 905438531.248.png 905438531.249.png 905438531.250.png 905438531.251.png 905438531.252.png 905438531.253.png 905438531.254.png 905438531.255.png 905438531.256.png 905438531.257.png 905438531.258.png 905438531.260.png 905438531.261.png 905438531.262.png 905438531.263.png 905438531.264.png 905438531.265.png 905438531.266.png 905438531.267.png 905438531.268.png 905438531.269.png 905438531.271.png 905438531.272.png 905438531.273.png 905438531.274.png 905438531.275.png 905438531.276.png 905438531.277.png 905438531.278.png 905438531.279.png 905438531.280.png 905438531.282.png 905438531.283.png 905438531.284.png 905438531.285.png 905438531.286.png 905438531.287.png
jQUERY 1.6
VISUAL CHEAT SHEET
SELECTORS ✼ CORE ✼ ATTRIBUTES ✼ CSS ✼ TRAVERSING ✼ MANIPULATION ✼ EVENTS ✼ EFFECTS ✼ AJAX ✼ UTILITIES ✼ DEFERRED OBJECT
Designed by Antonio Lupetti © 2011 • http://woorkup.com • http://twitter.com/woork | jQuery is © of John Resig and the jQuery Team.
˒ = NEW IN jQUERY 1.6 / f(x) = FUNCTION / a = ARRAY / jQ = jQUERY / El = ELEMENT / 0-1 = BOOLEAN / Obj = OBJECT / NUM = NUMBER / Str = STRING
CSS / 1. CSS
.outerHeight()
Get the current computed height for the first
element in the set of matched elements,
including padding, border, and optionally
margin.
TRAVERSING / 3. MISCELLANEOUS
.prop( propertyName ) ˒
Get the value of a property for the first element in
the set of matched elements.
.closest( selectors , [ context ] )
Get the first ancestor element that matches the
selector, beginning at the current element and
progressing up through the DOM tree.
Str
a
.add()
Add elements to the set of matched elements.
.css( propertyName )
Get the value of a style property for the first
element in the set of matched elements.
Int
jQ
Str
.prop( propertyName , value ) ˒
Set one or more properties for the set of matched
elements.
.add( selectors , [ context ] )
Add elements to the set of matched elements.
.find( selector )
Get the descendants of each element in the
current set of matched elements, filtered by a
selector, jQuery object, or element.
jQ
jQ
.outerWidth()
Get the current computed width for the first
element in the set of matched elements,
including padding and border.
.css( propertyName , value )
Set one or more CSS properties for the set of
matched elements.
jQ
jQ
Int
.andSelf()
Add the previous set of elements on the stack to
the current set.
.removeprop( propertyName , value ) ˒
Remove a property for the set of matched elements
jQ
jQ
.next( [ selector ] )
Get the immediately following sibling of each
element in the set of matched elements, optionally
filtered by a selector.
.width( value )
Set the CSS width of each element in the set of
matched elements.
CSS / 2. POSITIONING
jQ
.contents()
Get the children of each element in the set of
matched elements, including text nodes.
jQ
jQ
.scrollLeft()
Get the current horizontal position of the
scroll bar for the first element in the set of
matched elements.
ATTRIBUTES / 2. CLASS
.width()
Get the current computed width for the first
element in the set of matched elements.
Int
.addClass( class )
Adds the specified class(es) to each of the set of
matched elements.
.nextAll( [ selector ] )
Get all following siblings of each element in the
set of matched elements, optionally filtered by a
selector.
Int
.end()
End the most recent filtering operation in the
current chain and return the set of matched
elements to its previous state.
jQ
jQ
jQ
.scrollLeft( value )
Set the current horizontal position of the
scroll bar for each of the set of matched
elements.
.hasClass( class )
Determine whether any of the matched elements
are assigned the given class.
TRAVERSING / 1. FILTERING
jQ
0-
1
.nextUntil( [ selector ] )
Get all following siblings of each element up to
but not including the element matched by the
selector.
MANIPULATION / 1. INSIDE
.eq( - index )
Reduce the set of matched elements to the one at
the specified index.
jQ
jQ
.o ! set()
Get the current coordinates of the first
element in the set of matched elements,
relative to the document.
.removeClass( class )
Remove a single class, multiple classes, or all
classes from each element in the set of matched
elements.
.append( content )
Insert content, specified by the parameter, to the
end of each element in the set of matched
elements.
Obj
{ top, left }
jQ
jQ
.eq( index )
Reduce the set of matched elements to the one at
the specified index.
.o ! setParent()
Get the closest ancestor element that is
positioned.
jQ
jQ
.o ! set( coordinates )
Set the current coordinates of every element
in the set of matched elements, relative to
the document.
.toggleClass( class , switch )
Add or remove one or more classes from each
element in the set of matched elements, depending
on either the class's presence or the value of the
switch argument.
.append( function(index , html) )
Insert content, specified by the parameter, to the
end of each element in the set of matched
elements.
jQ
jQ
jQ
.filter( selector )
Reduce the set of matched elements to those that
match the selector or pass the function's test.
.parent( [ selector ] )
Get the parent of each element in the current set
of matched elements, optionally filtered by a
selector.
jQ
jQ
.position()
Get the current coordinates of the first
element in the set of matched elements,
relative to the offset parent.
.appendTo( target )
Insert every element in the set of matched
elements to the end of the target.
Obj
{ top, left }
.is( selector )
Check the current matched set of elements
against a selector, element, or jQuery object and
return true if at least one of these elements
matches the given arguments.
jQ
ATTRIBUTES / 3. HTML
.parents( [ selector ] )
Get the ancestors of each element in the current
set of matched elements, optionally filtered by a
selector.
0-1
.html()
Get the HTML contents of the first element in the
set of matched elements.
.prepend( content )
Insert content, specified by the parameter, to the
beginning of each element in the set of matched
elements.
.scrollTop()
Get the current vertical position of the scroll
bar for the first element in the set of
matched elements.
jQ
Str
jQ
Int
.map( callback(index , domEl) )
Pass each element in the current matched set
through a function, producing a new jQuery
object containing the return values.
.html( htmlString )
Set the HTML contents of each element in the set of
matched elements.
.parentsUntil( [ selector ] )
Get the ancestors of each element in the current
set of matched elements, up to but not including
the element matched by the selector.
jQ
jQ
.prependTo( target )
Insert content, specified by the parameter, to the
end of each element in the set of matched
elements.
.scrollTop( value )
Set the current vertical position of the scroll
bar for each of the set of matched elements.
jQ
jQ
.not()
Remove elements from the set of matched
elements.
ATTRIBUTES / 4. TEXT
.prev( [ selector ] )
Get the immediately preceding sibling of each
element in the set of matched elements, optionally
filtered by a selector.
jQ
CSS / 3. HEIGHT & WIDTH
jQ
MANIPULATION / 2. OUTSIDE
.text()
Get the combined text contents of each element in
the set of matched elements, including their
descendants.
.height( value )
Set the CSS height of every matched
element.
Str
.slice( start , [ end ] )
Reduce the set of matched elements to a subset
specified by a range of indices.
.after( content )
Insert content, specified by the parameter, after
each element in the set of matched elements.
jQ
jQ
jQ
.prevAll( [ selector ] )
Get all preceding siblings of each element in the
set of matched elements, optionally filtered by a
selector.
.text( textString )
Set the content of each element in the set of
matched elements to the specified text.
.height()
Get the current computed height for the first
element in the set of matched elements.
jQ
.after( function(index) )
Insert content, specified by the parameter, to the
end of each element in the set of matched
elements.
jQ
Int
TRAVERSING / 2. TREE TRAVERSAL
jQ
.prevUntil( [ selector ] )
Get the ancestors of each element in the current
set of matched elements, optionally filtered by a
selector.
.innerHeight()
Get the current computed height for the first
element in the set of matched elements,
including padding but not border.
.children( [ selector ] )
Get the children of each element in the set of
matched elements, optionally filtered by a
selector.
ATTRIBUTES / 5. VALUE
Int
jQ
jQ
.before( content )
Insert content, specified by the parameter, before
each element in the set of matched elements.
jQ
.val()
Get the current value of the first element in the set
of matched elements.
Str
| a
.innerWidth()
Get the current computed width for the first
element in the set of matched elements,
including padding but not border.
.closest( selector )
Get the first ancestor element that matches the
selector, beginning at the current element and
progressing up through the DOM tree.
.siblings( [ selector ] )
Get the siblings of each element in the set of
matched elements, optionally filtered by a
selector.
.before( function )
Insert content, specified by the parameter, before
each element in the set of matched elements.
Int
jQ
jQ
jQ
.val( value )
Set the value of each element in the set of matched
elements.
jQ
905438531.288.png 905438531.289.png 905438531.290.png 905438531.291.png 905438531.293.png 905438531.294.png 905438531.295.png 905438531.296.png 905438531.297.png 905438531.298.png 905438531.299.png 905438531.300.png 905438531.301.png 905438531.302.png 905438531.002.png 905438531.003.png 905438531.004.png 905438531.005.png 905438531.006.png 905438531.007.png 905438531.008.png 905438531.009.png 905438531.010.png 905438531.011.png 905438531.013.png 905438531.014.png 905438531.015.png 905438531.016.png 905438531.017.png 905438531.018.png 905438531.019.png 905438531.020.png 905438531.021.png 905438531.022.png 905438531.024.png 905438531.025.png 905438531.026.png 905438531.027.png 905438531.028.png 905438531.029.png 905438531.030.png 905438531.031.png 905438531.032.png 905438531.033.png 905438531.035.png 905438531.036.png 905438531.037.png 905438531.038.png 905438531.039.png 905438531.040.png 905438531.041.png 905438531.042.png 905438531.043.png 905438531.044.png 905438531.046.png 905438531.047.png 905438531.048.png 905438531.049.png 905438531.050.png 905438531.051.png 905438531.052.png 905438531.053.png 905438531.054.png 905438531.055.png 905438531.057.png 905438531.058.png 905438531.059.png 905438531.060.png 905438531.061.png 905438531.062.png 905438531.063.png 905438531.064.png
jQUERY 1.6
VISUAL CHEAT SHEET
SELECTORS ✼ CORE ✼ ATTRIBUTES ✼ CSS ✼ TRAVERSING ✼ MANIPULATION ✼ EVENTS ✼ EFFECTS ✼ AJAX ✼ UTILITIES ✼ DEFERRED OBJECT
Designed by Antonio Lupetti © 2011 • http://woorkup.com • http://twitter.com/woork | jQuery is © of John Resig and the jQuery Team.
˒ = NEW IN jQUERY 1.6 / f(x) = FUNCTION / a = ARRAY / jQ = jQUERY / El = ELEMENT / 0-1 = BOOLEAN / Obj = OBJECT / NUM = NUMBER / Str = STRING
.insertAfter( target )
Insert every element in the set of matched
elements after the target.
EVENTS / 3. MOUSE EVENTS
EVENTS / 4. FORM EVENTS
MANIPULATION / 6. COPYING
event.pageX
The mouse position relative to the left edge of
the document.
jQ
Num
.blur( handler(eventObject) )
Bind an event handler to the "blur" JavaScript
event, or trigger that event on an element.
.clone( [ withDataAndEvents ] )
Create a deep copy of the set of matched
elements.
.click( handler(eventObject) )
Bind an event handler to the "click" JavaScript
event, or trigger that event on an element.
jQ
jQ
jQ
.insertBefore( target )
Insert every element in the set of matched
elements before the target.
event.pageY
The mouse position relative to the top edge of
the document.
jQ
.change( handler(eventObject) )
Bind an event handler to the "change"
JavaScript event, or trigger that event on an
element.
Num
.dblclick( handler(eventObject) )
Bind an event handler to the "dblclick"
JavaScript event, or trigger that event on an
element.
EVENTS / 1. DOCUMENT LOADING
jQ
jQ
MANIPULATION / 3. AROUND
.load( handler(eventObject) )
Bind an event handler to the "load" JavaScript
event.
event.preventDefault()
If this method is called, the default action
of the event will not be triggered.
jQ
.focus( handler(eventObject) )
Bind an event handler to the "focus" JavaScript
event, or trigger that event on an element.
.unwrap()
Remove the parents of the set of matched
elements from the DOM, leaving the matched
elements in their place.
.focusin( handler(eventObject) )
Bind an event handler to the "focusin" JavaScript
event.
jQ
jQ
jQ
.ready( handler )
Specify a function to execute when the DOM is
fully loaded.
event.relatedTarget
The other DOM element involved in the event,
if any.
jQ
.select( handler(eventObject) )
Bind an event handler to the "select" JavaScript
event, or trigger that event on an element.
El
.focusout( handler(eventObject) )
Bind an event handler to the "focusout"
JavaScript event.
jQ
.wrap( wrappingElement )
Wrap an HTML structure around each element in
the set of matched elements.
jQ
jQ
.unload( handler(eventObject) )
Bind an event handler to the "unload" JavaScript
event.
event.result
This attribute contains the last value returned
by an event handler that was triggered by this
event, unless the value was undefined.
jQ
.submit( handler(eventObject) )
Bind an event handler to the "submit" JavaScript
event, or trigger that event on an element.
Anything
Obj
jQ
.wrap( wrappingFunction )
Wrap an HTML structure around each element in
the set of matched elements.
.hover( handlerIn(eventObject) ,
handlerOut(eventObject) )
Bind two handlers to the matched elements, to be
executed when the mouse pointer enters and
leaves the elements.
jQ
jQ
EVENTS / 2. HANDLER ATTACHMENT
EVENTS / 2. HANDLER ATTACHMENT
event.stopImmediatePropagation()
Prevents other event handlers from being
called.
EVENTS / 5 KEYBOARD EVENTS
.wrapAll( wrappingElement )
Wrap an HTML structure around all elements in
the set of matched elements.
.bind( eventType , [ eventData ] , handler
(eventObject) )
Attach a handler to an event for the elements.
jQ
.keydown( handler(eventObject) )
Bind an event handler to the "keydown"
JavaScript event, or trigger that event on an
element.
jQ
.hover( handler(eventObject) )
Bind a single handler to the matched elements, to
be executed when the mouse pointer enters or
leaves the elements.
jQ
event.stopPropagation()
Prevents the event from bubbling up the DOM
tree, preventing any parent handlers from
being notified of the event.
jQ
.wrapInner( wrappingElement )
Wrap an HTML structure around the content of
each element in the set of matched elements.
.delegate( selector , eventType ,
handler )
Attach a handler to one or more events for all
elements that match the selector, now or in the
future, based on a specific set of root elements.
jQ
.keypress( handler(eventObject) )
Bind an event handler to the "keypress"
JavaScript event, or trigger that event on an
element.
jQ
.mousedown( handler(eventObject) )
Bind an event handler to the "mousedown"
JavaScript event, or trigger that event on an
element.
jQ
.wrapInner( wrappingFunction )
Wrap an HTML structure around the content of
each element in the set of matched elements.
event.target
The DOM element that initiated the event.
jQ
jQ
El
.die()
Remove all event handlers previously attached
using .live() from the elements.
.keyup( handler(eventObject) )
Bind an event handler to the "keyup" JavaScript
event, or trigger that event on an element.
jQ
event.timeStamp
This attribute returns the number of
milliseconds since January 1, 1970, when the
event is triggered.
.mouseenter( handler(eventObject) )
Bind an event handler to be fired when the
mouse enters an element, or trigger that handler
on an element.
jQ
MANIPULATION / 4. REPLACING
Num
jQ
.live( eventType , eventData , handler )
Attach a handler to the event for all elements
which match the current selector, now or in the
future.
.replaceWith( newContent )
Replace each element in the set of matched
elements with the provided new content.
jQ
jQ
EVENTS / 6. EVENT OBJECT
.mouseleave( handler(eventObject) )
Bind an event handler to be fired when the
mouse leaves an element, or trigger that handler
on an element.
event.type
Describes the nature of the event.
Str
event.currentTarget
The current DOM element within the event
bubbling phase.
.replaceWith( function )
Replace each element in the set of matched
elements with the provided new content.
jQ
.one( eventType , [ eventData ] , handler
(eventObject) )
Attach a handler to an event for the elements.
The handler is executed at most once per element.
El
jQ
jQ
event.which
For key or button events, this attribute
indicates the specific button or key that was
pressed.
.mousemove( handler(eventObject) )
Bind an event handler to the "mousemove"
JavaScript event, or trigger that event on an
element.
.replaceAll()
A selector expression indicating which element(s)
to replace.
Str
event.data
Contains the optional data passed to
jQuery.fn.bind when the current executing
handler was bound.
jQ
jQ
.trigger( eventType , extraParameters )
Execute all handlers and behaviors attached to
the matched elements for the given event type.
jQ
EVENTS / 6. BROWSER EVENTS
.mouseout( handler(eventObject) )
Bind an event handler to the "mouseout"
JavaScript event, or trigger that event on an
element.
MANIPULATION / 5. REMOVING
.triggerHandler( eventType ,
extraParameters )
Execute all handlers attached to an element for
an event.
event.isDefaultPrevented()
Returns whether event.preventDefault() was
ever called on this event object.
jQ
0-1
.error( handler(eventObject) )
Bind an event handler to the "error"
JavaScript event.
jQ
.detach( [ selector ] )
Remove the set of matched elements from the
DOM.
jQ
jQ
event.
isImmediatePropagationStopped()
Returns whether
event.stopImmediatePropagation() was ever
called on this event object.
.mouseover( handler(eventObject) )
Bind an event handler to the "mouseover"
JavaScript event, or trigger that event on an
element.
.unbind( eventType , handler
(eventObject) )
Remove a previously-attached event handler
from the elements.
.resize( handler(eventObject) )
Bind an event handler to the "resize"
JavaScript event, or trigger that event on an
element.
.empty()
Remove all child nodes of the set of matched
elements from the DOM.
jQ
0-1
jQ
jQ
jQ
.remove( [ selector ] )
Remove the set of matched elements from the
DOM.
.mouseup( handler(eventObject) )
Bind an event handler to the "mouseup"
JavaScript event, or trigger that event on an
element.
.undelegate()
Remove a handler from the event for all elements
which match the current selector, now or in the
future, based upon a specific set of root elements.
.scroll( handler(eventObject) )
Bind an event handler to the "scroll"
JavaScript event, or trigger that event on an
element.
jQ
event.isPropagationStopped()
Returns whether event.stopPropagation() was
ever called on this event object.
jQ
jQ
0-1
jQ
905438531.065.png 905438531.066.png 905438531.068.png 905438531.069.png 905438531.070.png 905438531.071.png 905438531.072.png 905438531.073.png 905438531.074.png 905438531.075.png 905438531.076.png 905438531.077.png 905438531.079.png 905438531.080.png 905438531.081.png 905438531.082.png 905438531.083.png 905438531.084.png 905438531.085.png 905438531.086.png 905438531.087.png 905438531.088.png 905438531.090.png 905438531.091.png 905438531.092.png 905438531.093.png 905438531.094.png 905438531.095.png 905438531.096.png 905438531.097.png 905438531.098.png 905438531.099.png 905438531.101.png 905438531.102.png 905438531.103.png 905438531.104.png 905438531.105.png 905438531.106.png 905438531.107.png 905438531.108.png 905438531.109.png 905438531.110.png 905438531.112.png 905438531.113.png 905438531.114.png 905438531.115.png 905438531.116.png 905438531.117.png 905438531.118.png 905438531.119.png 905438531.120.png 905438531.121.png 905438531.123.png 905438531.124.png 905438531.125.png 905438531.126.png 905438531.127.png 905438531.128.png 905438531.129.png 905438531.130.png 905438531.131.png 905438531.132.png 905438531.134.png 905438531.135.png 905438531.136.png 905438531.137.png 905438531.138.png 905438531.139.png 905438531.140.png 905438531.141.png 905438531.142.png 905438531.143.png 905438531.145.png 905438531.146.png
jQUERY 1.6
VISUAL CHEAT SHEET
SELECTORS ✼ CORE ✼ ATTRIBUTES ✼ CSS ✼ TRAVERSING ✼ MANIPULATION ✼ EVENTS ✼ EFFECTS ✼ AJAX ✼ UTILITIES ✼ DEFERRED OBJECT
Designed by Antonio Lupetti © 2011 • http://woorkup.com • http://twitter.com/woork | jQuery is © of John Resig and the jQuery Team.
˒ = NEW IN jQUERY 1.6 / f(x) = FUNCTION / a = ARRAY / jQ = jQUERY / El = ELEMENT / 0-1 = BOOLEAN / Obj = OBJECT / NUM = NUMBER / Str = STRING / = PROMISE
jQuery.ajaxSetup( option )
Set default values for future Ajax requests.
AJAX / 4. DATA
DEFERRED OBJECT
EFFECTS / 1. BASIC
jQuery.isPlainObject( obj )
Check to see if an object is a plain object
(created using "{}" or "new Object").
0-1
0-1
.serialize()
Encode a set of form elements as a string for
submission.
.hide( duration , [ callback ] )
Hide the matched elements.
deferred.done( doneCallbacks )
Add handlers to be called when the Deferred
object is resolved.
jQ
Str
Def
jQuery.isXMLDoc( node )
Check to see if a DOM node is within an XML
document (or is an XML document).
AJAX / 2. SHORTHAND METHODS
.show( duration , [ callback ] )
Display the matched elements.
0-1
jQ
.serializeArray()
Encode a set of form elements as an array of
names and values.
jQuery.get( url , [ data ] , [ callback(data,
textStatus , XMLHttpRequest) ] ,
[ dataType ] )
Load data from the server using a HTTP GET
request.
a
deferred.fail( failCallbacks )
Add handlers to be called when the Deferred
object is rejected.
Def
jQuery.makeArray( obj )
Convert an array-like object into a true
JavaScript array.
jqXHR
EFFECTS / 2. SLIDING
a
UTILITIES / 1. UTILITIES
.slideDown( [ duration ] , [ callback ] )
Display the matched elements with a sliding
motion.
deferred.isRejected()
Determine whether a Deferred object has been
rejected.
jQ
jQuery.getJSON( url , [ data ] ,
[ callback(data, textStatus) ] )
Load JSON-encoded data from the server
using a GET HTTP request.
jQuery.map( array , callback
(elementOfArray , indexInArray) )
Translate all items in an array or object to
new array of items.
0-1
jQuery.browser
Contains flags for the useragent, read from
navigator.userAgent. While jQuery.browser will
not be removed from future versions of jQuery,
every effort to use jQuery.support and proper
feature detection should be made.
jqXHR
a
.slideToggle( [ duration ] , [ callback ] )
Display or hide the matched elements with a
sliding motion.
Map
jQ
deferred.isResolved()
Determine whether a Deferred object has been
resolved.
0-1
jQuery.getScript( url , [ success(data,
textStatus) ] )
Load a JavaScript file from the server using a
GET HTTP request, then execute it.
jQuery.merge( first, second )
Merge the contents of two arrays together
into the first array.
.slideUp( [ duration ] , [ callback ] )
Hide the matched elements with a sliding
motion.
jqXHR
a
jQuery.browser.version
Returns the version number of the rendering
engine for the user's browser.
jQ
Str
deferred.promise()
Return a Deferred's Promise object.
jQuery.noop()
An empty function.
Def
.load( url , [ data ] , [ complete
(responseText , textStatus ,
XMLHttpRequest) ] )
Load data from the server and place the
returned HTML into the matched element.
EFFECTS / 3. FADING
jQuery.contains( container , contained )
Check to see if a DOM node is within another
DOM node.
jQ
0-1
jQuery.parseJSON( json )
Takes a well-formed JSON string and
returns the resulting JavaScript object.
deferred.reject( args )
Reject a Deferred object and call any
failCallbacks with the given args.
.fadeIn( [ duration ] , [ callback ] )
Display the matched elements by fading them
to opaque.
Obj
Def
jQ
jQuery.each( collection , callback
(indexInArray , valueOfElement) )
Iterates through the array displaying each
number as both a word and numeral
jQuery.post( url , [ data ] , [ success
(data , textStatus , XMLHttpRequest) ] ,
[ dataType ] )
Load data from the server using a HTTP POST
request.
Obj
.fadeOut( [ duration ] , [ callback ] )
Hide the matched elements by fading them to
transparent.
jQuery.proxy( function , context )
Takes a function and returns a new one that
will always have a particular context.
deferred.rejectWith( context , [args] )
Reject a Deferred object and call any
failCallbacks with the given context and args.
jQ
jqXHR
f(x)
Def
jQuery.extend( target , [ object1 ] ,
[ objectN ] )
Merge the contents of two or more objects
together into the first object.
.fadeTo( duration , opacity , [ callback ] )
Adjust the opacity of the matched elements.
jQuery.queue( element ,
[ queueName ] )
Show the queue of functions to be executed
on the matched element.
jQ
Obj
deferred.resolve( args )
Resolve a Deferred object and call any
doneCallbacks with the given args.
a
Def
AJAX / 3. AJAX EVENT HANDLERS
EFFECTS / 4. CUSTOM
jQuery.globalEval( code )
Execute some JavaScript code globally.
.ajaxComplete( handler(event ,
XMLHttpRequest , ajaxOptions) )
Register a handler to be called when Ajax
requests complete.
jQuery.queue( element , queueName ,
newQueue )
Show the queue of functions to be executed
on the matched element.
.animate( properties , options )
Perform a custom animation of a set of CSS
properties.
deferred.resolveWith( args )
Resolve a Deferred object and call any
doneCallbacks with the given context and args.
jQ
jQ
a
Def
jQuery.hasData( element )
Determine whether an element has any jQuery
data associated with it.
0-1
.delay( duration , [ queueName ] )
Set a timer to delay execution of subsequent
items in the queue.
.ajaxStart( handler() )
Register a handler to be called when the first
Ajax request begins.
deferred.then( doneCallbacks ,
failCallbacks )
Add handlers to be called when the Deferred
object is resolved or rejected.
jQuery.removeData( element ,
[ name ] )
Remove a previously-stored piece of data.
jQ
jQ
jQuery.grep( array , function
(elementOfArray , indexInArray) , [ invert ] )
Finds the elements of an array which satisfy a
filter function. The original array is not affected.
jQ
Def
a
.stop( [ clearQueue ], [ jumpToEnd ] )
Stop the currently-running animation on the
matched elements.
.ajaxStop( handler() )
Hide a loading message after all the Ajax
requests have stopped.
jQuery.support
A collection of properties that represent the
presence of different browser features or
bugs.
jQ
jQ
deferred. always( alwaysCallbacks ) ˒
Add handlers to be called when the Deferred
object is either resolved or rejected.
Obj
jQuery.inArray( value, array )
Search for a specified value within an array and
return its index (or -1 if not found).
Def
Nu
m
jQuery.fx.o !
Globally disable all animations.
.ajaxError( handler(event ,
XMLHttpRequest , ajaxOptions ,
thrownError) )
Register a handler to be called when Ajax
requests complete with an error.
0-1
jQuery.trim( str )
Remove the whitespace from the beginning
and end of a string.
jQ
deferred. pipe( [ doneFilter ] ,
[ failFilter ] ) ˒
Utility method to filter and/or chain Deferreds.
Obj
AJAX / 1. LOW-LEVEL INTERFACE
jQuery.isArray( obj )
Determine whether the argument is an array.
0-1
jQuery.ajax( url , [ settings ] )
Perform an asynchronous HTTP (Ajax)
request.
.ajaxSend( handler(event ,
XMLHttpRequest , ajaxOptions) )
Show a message before an Ajax request is sent.
jQuery.parseXML( data )
Parses a string into an XML document.
XMLdoc
jQ
.promise( [ type ] , [ target ] ) ˒
Return a Promise object to observe when all
actions of a certain type bound to the collection,
queued or not, have finished.
jQuery.isEmptyObject( obj )
Check to see if an object is empty (contains no
properties).
0-1
jQuery.unique()
Sorts an array of DOM elements, in place,
with the duplicates removed.
.ajaxSuccess( handler(event ,
XMLHttpRequest , ajaxOptions) )
Show a message when an Ajax request
completes successfully.
jQuery.ajax( settings )
Perform an asynchronous HTTP (Ajax)
request.
jQ
jQ
jQuery.isFunction( obj )
Determine if the argument passed is a Javascript
function object.
0-1
905438531.147.png 905438531.148.png 905438531.149.png 905438531.150.png 905438531.151.png 905438531.152.png 905438531.153.png 905438531.154.png 905438531.156.png 905438531.157.png 905438531.158.png 905438531.159.png 905438531.160.png 905438531.161.png 905438531.162.png 905438531.163.png 905438531.164.png 905438531.165.png 905438531.167.png 905438531.168.png 905438531.169.png 905438531.170.png 905438531.171.png 905438531.172.png 905438531.173.png 905438531.174.png 905438531.175.png 905438531.176.png 905438531.178.png 905438531.179.png 905438531.180.png 905438531.181.png 905438531.182.png 905438531.183.png 905438531.184.png 905438531.185.png 905438531.186.png 905438531.187.png 905438531.189.png 905438531.190.png 905438531.191.png 905438531.192.png 905438531.193.png 905438531.194.png 905438531.195.png 905438531.196.png 905438531.197.png 905438531.198.png 905438531.200.png 905438531.201.png 905438531.202.png 905438531.203.png 905438531.204.png 905438531.205.png 905438531.206.png 905438531.207.png 905438531.208.png 905438531.209.png 905438531.211.png 905438531.212.png 905438531.213.png 905438531.214.png 905438531.215.png 905438531.216.png 905438531.217.png 905438531.218.png 905438531.219.png 905438531.220.png 905438531.222.png 905438531.223.png 905438531.224.png 905438531.225.png 905438531.226.png 905438531.227.png 905438531.228.png 905438531.229.png
Zgłoś jeśli naruszono regulamin