Académique Documents
Professionnel Documents
Culture Documents
4 Cheat Sheet
ImpulseStudios.ca
Core
Selectors
Effects
Events
Ajax
jQuery Function
Basic
Basics
Document Loading
$(selector, context)
$(html, owner)
$(callback)
jQuery
jQuery
jQuery
No Conflict
jQuery
jQuery.noConflict(bool)
General Attributes
obj
jQuery
jQuery
jQuery
string
jQuery
string
jQuery
string, array
jQuery
.attr(attribute)
.attr(attribute, val)
.attr(attribute, fn)
.removeAttr(attribute)
.html()
.html(string)
.text()
.text(string)
.val()
.val(value)
CSS
Style Properties
string
jQuery
.css(property)
.css(property, val|fn)*
Class Attribute
jQuery
jQuery
bool
jQuery
.addClass(name|fn)*
.removeClass(name|fn)*
.hasClass(name)
.toggleClass(name|fn, switch)*
Dimensions
int
jQuery
int
jQuery
int
int
int
int
.height()
.height(val)
.width()
.width(val)
.innerHeight()
.innerWidth()
.outerHeight(margin)
.outerWidth(margin)
Offset
obj{top,left}
obj
obj{top,left}
int
jQuery
int
jQuery
jQuery
obj
array
jQuery
jQuery
jQuery
Miscellaneous
Collection Manipulation
.each(fn)
jQuery
Collection Manipulation
.get(index)
.index(selector|element)*
.size()
.toArray()*
.fadeIn(dur, cb)
.fadeOut(dur, cb)
.fadeTo(dur, opacity, cb)
element, array
num
num
array
prev ~ siblings
.slideUp(dur, cb)
.slideDown(dur, cb)
.slideToggle(dur, cb)
Attribute
[attribute|=val]
[attribute*=val]
[attribute~=val]
[attribute$=val]
[attribute=val]
[attribute!=val]
[attribute^=val]
[attribute]
[attribute1=val1] [attribute2=val2]
jQuery
jQuery
jQuery
Custom
.animate(prop, dur, easing, cb)
.animate(prop, options)
.delay(dur, queueName)*
jQuery.fx.off
.stop(clearQueue, jumpToEnd)
jQuery
jQuery
jQuery
bool
jQuery
Manipulation
Basic Filter
.clone(withDataAndElements)
jQuery
jQuery
jQuery
jQuery
jQuery
:not(selector)
Content Filter
:contains(text)
:empty
:has(selector)
:parent
jQuery
jQuery
jQuery
jQuery
Visibility Filter
:hidden
:visible
jQuery
jQuery
jQuery
jQuery
DOM Removal
.detach(selector)*
.empty()
.remove(selector)
Child Filter
:first-child
:last-child
:nth-child(index/even/odd/eq)
:only-child
jQuery
jQuery
jQuery
DOM Replacement
.replaceAll()
.replaceWith(content|fn)*
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
fn
fn
jQuery
obj
Browser Events
.error(fn)
.resize(fn)
.scroll(fn)
jQuery
jQuery
jQuery
.blur(fn)
.change(fn)
.focus(fn)
.select(fn)
.submit(fn)
jQuery
jQuery
jQuery
jQuery
jQuery
Keyboard Events
.focusin(fn)*
.focusout(fn)*
.keydown(fn)
.keypress(fn)
.keyup(fn)
jQuery
jQuery
jQuery
jQuery
jQuery
Mouse Events
.click(fn)
.dblclick(fn)
.hover(fn, fn)
.mousedown(fn)
.mouseenter(fn)
.mouseleave(fn)
.mousemove(fn)
.mouseout(fn)
.mouseover(fn)
.mouseup(fn)
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
Event Object
jQuery
jQuery
Utilities
:button
:checkbox
:checked
:disabled
:enabled
:file
:image
:input
:password
:radio
:reset
:selected
:submit
:text
.load(fn)
.ready(fn)
.unload(fn)
Form Events
Copying
:animated
:eq(index)
:even
:odd
:first
:last
:gt(index)
:header
:lt(index)
jQuery.support
jQuery.browser
jQuery.browser.version
jQuery
jQuery
jQuery
Sliding
Form
Data
jQuery
jQuery
jQuery
jQuery
Fading
Hierarchy
Attributes
.offset()
.offset(coordinates)*
.position()
.scrollLeft()
.scrollLeft(val)
.scrollTop()
.scrollLeft(val)
.hide(dur, cb)
.show(dur, cb)
.toggle(dur, cb)
.toggle(showOrHide)
*
#id
element
.class
selector, selectorN
event.currentTarget
element
event.data
anything
event.isDefaultPrevented()
bool
event.isImmediatePropagationStopped()bool
event.isPropagationStopped()
bool
event.pageX
num
event.pageY
num
event.preventDefault
event.relatedTarget
element
event.result
obj
event.stopImmediatePropagation()
event.target
element
event.timeStamp
num
event.type
string
event.which
string
.ajaxComplete(cb)
.ajaxError(cb)
.ajaxSend(cb)
.ajaxStart(cb)
.ajaxStop(cb)
.ajaxSuccess(cb)
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
Helper Functions
jQuery.param(obj, traditional)*
.serialize()
.serialzeArray()
string
string
array
Low-Level Interface
jQuery.ajax(settings)
jQuery.ajaxSetup(options)
XHR
Shorthand Methods
jQuery.get(url, data, cb, type)
jQuery.post(url, data, cb, type)
jQuery.getJSON(url, data, cb)
jQuery.getScript(url, cb)
.load(url, data, cb)
XHR
XHR
XHR
XHR
jQuery
Traversing
Tree Traversal
.children(selector)
.closest(selector, context)*
.closest(selectors, context)*
.find(selector)
.next(selector)
.nextAll(selector)
.nextUntil(selector)*
.offsetParent()
.parent(selector)
.parents(selector)
.parentsUntil(selector)*
.prev(selector)
.prevAll(selector)
.prevUntil(selector)*
.siblings(selector)
jQuery
jQuery
array
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
Filtering
.eq(index)
.filter(selector)
.filter(fn)
.first()
.last()
.has(selector)*
.has(contained)*
.is(selector)
.map(cb)
.not(selector)
.not(elements)
.not(fn)
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
Miscellaneous Traversing
.add(selector)
.add(elements)
.add(html)
.add(selector, context)*
.andSelf()
.contents()
.end()
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
jQuery
Legend
light text
item|item
obj
bool
fn
optional parameter
or
object
boolean
function
cb
num
val
dur
*
callback
number
value
duration
new or updated in 1.4