Professional Documents
Culture Documents
Jquery 1.5 Visual Cheat Sheet PDF
Jquery 1.5 Visual Cheat Sheet PDF
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.
f(x) = FUNCTION
SELECTORS / 1. BASIC
:header Selector
<El(s)>
a<El(s)>
a<El>
a<El(s)>
a<El(s)>
:first Selector
Selects the first matched element.
a<El(s)>
a<El(s)>
a<El(s)>
a<El(s)>
a<El(s)>
a<El>
a<El>
a<El(s)>
a<El(s)>
:password Selector
Selects all elements of type password.
:radio Selector
a<El(s)>
:reset Selector
:selected Selector
Selects all elements that are selected.
a<El(s)>
:submit Selector
Selects all elements of type submit.
a<El(s)>
a<El(s)>
Str = STRING
a<El(s)>
a<El(s)>
:input Selector
:first-child Selector
:visible Selector
Selects all elements that are visible.
:text Selector
Selects all elements of type text.
a<El(s)>
a<El(s)>
a<El(s)>
a<El(s)>
a<El(s)>
a<El(s)>
a<El(s)>
a<El(s)>
a<El(s)>
:checkbox Selector
Selects all elements of type checkbox.
:checked Selector
Matches all elements that are checked.
a<El(s)>
:disabled Selector
Selects all elements that are disabled.
a<El(s)>
:enabled Selector
Selects all elements that are enabled.
jQuery.extend( object )
a<El(s)>
a<El(s)>
a<El(s)>
jQ
Num
.selector
A selector representing selector originally
passed to jQuery().
Str
Num
.toArray()
Retrieve all the DOM elements contained in the
jQuery set, as an array.
.removeData( [ name ] )
Remove a previously-stored piece of data.
jQ
jQ
jQ
.dequeue( [ queueName ] )
jQ
jQ
CORE / 4. INTEROPERABILITY
Obj
jQuery.fn.extend( object )
Extends the jQuery element set to provide new
methods (used to make a typical jQuery
plugin).
jQuery.extend( object )
Extends the jQuery object itself.
jQ
jQ
jQ
ATTRIBUTES / 1. ATTR
.attr( attributeName )
Get the value of an attribute for the first
element in the set of matched elements.
El
jQ
Obj
.length
Num
.data( obj )
.context
a<El(s)>
.index()
CORE / 3. DATA
jQuery.noConflict( )
a<El(s)>
El | a
a<El(s)>
jQuery.when()
a<El(s)>
:button Selector
Selects all button elements and elements of
type button.
.size()
a<El(s)>
.get( [ index ] )
jQuery()
SELECTORS / 8. FORM
[name=value]
Selects all elements that are headers, like
h1, h2, h3 and so on.
:hidden Selector
[name$=value]
a<El(s)>
NUM = NUMBER
jQuery.sub()
[name~=value]
Selects elements that have the specified
attribute with a value containing a given
word, delimited by spaces.
:only-child Selector
[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 (-).
Obj = OBJECT
:image Selector
[name^=value]
Selects elements that have the specified
attribute with a value beginning exactly
with a given string.
:file Selector
a<El(s)>
:nth-child Selector
[name*=value]
:gt() Selector
Select all elements at an index greater than
index within the matched set.
:last-child Selector
SELECTORS / 5. ATTRIBUTE
:eq() Selector
:even Selector
0-1 = BOOLEAN
:animated Selector
a<El(s)>
:parent Selector
a<El(s)>
:has() Selector
Selects elements which contain at least one
element that matches the specified selector.
a<El(s)>
:empty Selector
Select all elements that have no children
(including text nodes).
El = ELEMENT
[name=value][name2=value2]
:contains() Selector
a<El(s)>
SELECTORS / 2. HIERARCHY
[name]
:odd Selector
a<El(s)>
:not() Selector
ID Selector (#id)
Selects a single element with the given id
attribute.
a<El>
/ jQ = jQUERY
[name!=value]
:lt() Selector
a = ARRAY
a<El(s)>
:last Selector
a<El(s)>
Obj
.removeAttr()
Remove an attribute from each element in the
set of matched elements.
jQ
jQUERY 1.5
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.
f(x) = FUNCTION
a = ARRAY
/ jQ = jQUERY
El = ELEMENT
ATTRIBUTES / 2. CLASS
CSS / 2. POSITIONING
.width( value )
.addClass( class )
.scrollLeft()
jQ
.hasClass( class )
Determine whether any of the matched
elements are assigned the given class.
0-1
jQ
jQ
.position()
.html()
Str
jQ
jQ
Obj
{top, left}
Int
jQ
.css( propertyName )
Str
Int
0-1
jQ
jQ
jQ
jQ
.outerHeight()
Int
.osetParent()
Get the closest ancestor element that is
positioned.
jQ
jQ
jQ
jQ
jQ
jQ
jQ
.prepend( content )
jQ
jQ
.prependTo( target )
jQ
jQ
MANIPULATION / 2. OUTSIDE
jQ
.after( content )
Insert content, specified by the parameter, after
each element in the set of matched elements.
jQ
.after( function(index) )
jQ
jQ
.before( content )
jQ
jQ
.before( function )
Insert content, specified by the parameter, before
each element in the set of matched elements.
TRAVERSING / 3. MISCELLANEOUS
Add elements to the set of matched elements.
jQ
.appendTo( target )
jQ
.prev( [ selector ] )
.add()
.parentsUntil( [ selector ] )
jQ
.append( content )
jQ
.siblings( [ selector ] )
jQ
MANIPULATION / 1. INSIDE
.parents( [ selector ] )
jQ
.end()
.parent( [ selector ] )
.contents()
.prevUntil( [ selector ] )
jQ
.find( selector )
Int
.andSelf()
jQ
.nextAll( [ selector ] )
.closest( selector )
Int
Str = STRING
.prevAll( [ selector ] )
.children( [ selector ] )
Int
.outerWidth()
jQ
.innerWidth()
jQ
CSS / 1. CSS
Get the value of a style property for the first
element in the set of matched elements.
NUM = NUMBER
.is( selector )
.innerHeight()
Str |
a
.val( value )
Set the value of each element in the set of
matched elements.
jQ
.height()
ATTRIBUTES / 5. VALUE
.val()
jQ
.not()
.height( value )
.text( textString )
jQ
Str
.nextUntil( [ selector ] )
.filter( selector )
.text()
Get the combined text contents of each element
in the set of matched elements, including their
descendants.
TRAVERSING / 1. FILTERING
Obj = OBJECT
.eq( index )
.scrollTop( value )
ATTRIBUTES / 4. TEXT
Int
.eq( - index )
Obj
{top, left}
.scrollTop()
.html( htmlString )
Set the HTML contents of each element in the
set of matched elements.
jQ
.next( [ selector ] )
jQ
.width()
Get the current computed width for the first
element in the set of matched elements.
.oset( coordinates )
Set the current coordinates of every element
in the set of matched elements, relative to
the document.
ATTRIBUTES / 3. HTML
Get the HTML contents of the first element in
the set of matched elements.
.oset()
Get the current coordinates of the first
element in the set of matched elements,
relative to the document.
Int
.scrollLeft( value )
Set the current horizontal position of the
scroll bar for each of the set of matched
elements.
.removeClass( class )
Remove a single class, multiple classes, or all
classes from each element in the set of matched
elements.
0-1 = BOOLEAN
jQ
jQ
jQ
.insertAfter( target )
Insert every element in the set of matched
elements after the target.
jQ
.insertBefore( target )
Insert every element in the set of matched
elements before the target.
jQ
jQUERY 1.5
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.
MANIPULATION / 3. AROUND
.unwrap()
Remove the parents of the set of matched
elements from the DOM, leaving the matched
elements in their place.
jQ
jQ
jQ
jQ
.wrapInner( wrappingElement )
Wrap an HTML structure around the content of
each element in the set of matched elements.
jQ
.wrapInner( wrappingFunction )
Wrap an HTML structure around the content of
each element in the set of matched elements.
jQ
MANIPULATION / 4. REPLACING
jQ
El = ELEMENT
0-1 = BOOLEAN
jQ
.replaceAll()
jQ
jQ
jQ
jQ
.focusin( handler(eventObject) )
Bind an event handler to the "focusin" JavaScript
event.
.hover( handlerIn(eventObject),
handlerOut(eventObject) )
jQ
jQ
jQ
jQ
.clone( [ withDataAndEvents ] )
Create a deep copy of the set of matched elements.
jQ
jQ
jQ
jQ
jQ
jQ
jQ
jQ
jQ
jQ
event.result
This attribute contains the last value returned
Obj
by an event handler that was triggered by thisAnything
event, unless the value was undefined.
event.stopPropagation()
jQ
event.target
jQ
jQ
event.type
jQ
jQ
jQ
jQ
El
event.data
Contains the optional data passed to
jQuery.fn.bind when the current executing
handler was bound.
event.
isImmediatePropagationStopped()
Returns whether
event.stopImmediatePropagation() was ever
called on this event object.
.error( handler(eventObject) )
0-1
Str
jQ
.resize( handler(eventObject) )
0-1
jQ
.scroll( handler(eventObject) )
event.isPropagationStopped()
Returns whether event.stopPropagation() was
ever called on this event object.
Str
event.isDefaultPrevented()
Returns whether event.preventDefault() was
ever called on this event object.
Num
event.which
event.currentTarget
The current DOM element within the event
bubbling phase.
El
event.timeStamp
El
.keyup( handler(eventObject) )
jQ
event.relatedTarget
event.stopImmediatePropagation()
.keypress( handler(eventObject) )
jQ
Num
event.preventDefault()
.keydown( handler(eventObject) )
jQ
Num
.mouseup( handler(eventObject) )
Bind an event handler to the "mouseup"
JavaScript event, or trigger that event on an
element.
.submit( handler(eventObject) )
.mouseover( handler(eventObject) )
.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.
event.pageY
.select( handler(eventObject) )
.mouseout( handler(eventObject) )
jQ
MANIPULATION / 6. COPYING
jQ
.mouseenter( handler(eventObject) )
Bind an event handler to be fired when the
mouse enters an element, or trigger that handler
on an element.
jQ
.focus( handler(eventObject) )
.mouseleave( handler(eventObject) )
jQ
jQ
.mousedown( handler(eventObject) )
Bind an event handler to the "mousedown"
JavaScript event, or trigger that event on an
element.
.change( handler(eventObject) )
.hover( handler(eventObject) )
.triggerHandler( eventType,
extraParameters )
jQ
.dblclick( handler(eventObject) )
.remove( [ selector ] )
Str = STRING
.detach( [ selector ] )
.load( handler(eventObject) )
.mousemove( handler(eventObject) )
jQ
NUM = NUMBER
event.pageX
MANIPULATION / 5. REMOVING
.empty()
.blur( handler(eventObject) )
Obj = OBJECT
.click( handler(eventObject) )
.replaceWith( function )
Replace each element in the set of matched
elements with the provided new content.
.die()
.replaceWith( newContent )
Replace each element in the set of matched
elements with the provided new content.
/ jQ = jQUERY
.focusout( handler(eventObject) )
.wrapAll( wrappingElement )
Wrap an HTML structure around all elements in
the set of matched elements.
a = ARRAY
.unload( handler(eventObject) )
.wrap( wrappingFunction )
Wrap an HTML structure around each element in
the set of matched elements.
.ready( handler )
.wrap( wrappingElement )
Wrap an HTML structure around each element in
the set of matched elements.
f(x) = FUNCTION
0-1
jQ
jQUERY 1.5
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.
f(x) = FUNCTION
EFFECTS / 1. BASIC
jQ
jQuery.fx.o
jQ
EFFECTS / 2. SLIDING
.slideDown( [ duration ], [ callback ] )
Display the matched elements with a sliding
motion.
jQ
jQ
jQ
jQ
0-1
jQ
jQ
jqXHR
jqXHR
jQ
jQuery.fx.o
Globally disable all animations.
jQ
0-1
jqXHR
jQ
jQ
jQ
Str
.serializeArray()
Encode a set of form elements as an array of
names and values.
jQ
Str = STRING
jQuery.removeData( element,
[ name ] )
a
jQuery.isArray( obj )
jQuery.makeArray( obj )
jQuery.browser
jQuery.parseXML( data )
0-1
0-1
Obj
jQuery.queue( element,
[ queueName ] )
jQuery.globalEval( code )
0-1
deferred.done( doneCallbacks )
Add handlers to be called when the
Deferred object is resolved.
0-1
0-1
deferred.isResolved()
Determine whether a Deferred object has
been resolved.
deferred.promise()
a
Deferred
deferred.isRejected()
Determine whether a Deferred object has
been rejected.
Deferred
deferred.fail( failCallbacks )
Add handlers to be called when the
Deferred object is rejected.
0-1
Promise
deferred.reject( args )
Reject a Deferred object and call any
failCallbacks with the given args.
Deferred
deferred.rejectWith( context,[args] )
Obj
Deferred
deferred.resolve( args )
f(x)
Deferred
deferred.resolveWith( args )
a
jQ
DEFERRED OBJECT
0-1
jQuery.noop()
jQuery.parseJSON( json )
jQuery.unique()
Sorts an array of DOM elements, in place,
with the duplicates removed.
An empty function.
XMLdoc
0-1
Obj
0-1
jQuery.isXMLDoc( node )
UTILITIES / 1. UTILITIES
Obj
jQuery.trim( str )
Remove the whitespace from the beginning
and end of a string.
jQuery.isPlainObject( obj )
Check to see if an object is a plain object
(created using "{}" or "new Object").
jQ
jQuery.support
jQuery.isEmptyObject( obj )
jQuery.hasData( element )
.ajaxStart( handler() )
jQ
NUM = NUMBER
jQuery.isFunction( obj )
jqXHR
.ajaxComplete( handler(event,
XMLHttpRequest, ajaxOptions) )
jQ
jQuery.browser.version
EFFECTS / 4. CUSTOM
Perform a custom animation of a set of CSS
properties.
jqXHR
Obj = OBJECT
.ajaxSuccess( handler(event,
XMLHttpRequest, ajaxOptions) )
.serialize()
jQ
jQ
AJAX / 4. DATA
jQ
0-1
0-1 = BOOLEAN
.ajaxError( handler(event,
XMLHttpRequest, ajaxOptions,
thrownError) )
.ajaxSend( handler(event,
XMLHttpRequest, ajaxOptions) )
EFFECTS / 4. CUSTOM
El = ELEMENT
.ajaxStop( handler() )
jQ
/ jQ = jQUERY
jQuery.ajaxSetup( option )
a = ARRAY
jQuery.ajax( settings )
deferred.then( doneCallbacks,
failCallbacks )
Add handlers to be called when the
Deferred object is resolved or rejected.
Deferred
Deferred