際際滷

際際滷Share a Scribd company logo
Beginners essential
jQuery Cheat Sheet
Write less, and do more!
An essential tool for rapid web development.
#################
TABLE OF CONTENTS
Selectors 3
Attributes / CSS 5
Manipulation 6
Traversing 7
Events 8
Effects 10
AJAX 11
Core 12
of
2 13
SELECTORS
Basics
*
.class
element
#id
selector1, selectorN, 
Heirarchy
parent > child
ancestor descendant
prev + next
prev ~ siblings
Basic Filters
:animated
:eq()
:even
:first
:gt()
:header
:lang()
:last
:lt()
:not()
:odd
:root
:target
Content Filters
:contains()
:empty
:has()
:parent
Visibility Filters
:hidden
:visible
Attribute
[name|="value"]
[name*="value"]
[name~="value"]
[name$="value"]
[name="value"]
[name!="value"]
[name^="value"]
[name]
[name="value"][name2="value2"]
Child Filters
:first-child
:first-of-type
of
3 13
:last-child
:last-of-type
:nth-child()
:nth-last-child()
:nth-last-of-type()
:nth-of-type()
:only-child
:only-of-type()
length
%
border-box | padding-box |
content-box | no-clip
Forms
:button
:checkbox
:checked
:disabled
:enabled
:focus
:file
:image
:input
:password
:radio
:reset
:selected
:submit
:text
of
4 13
ATTRIBUTES / CSS
Attributes
.attr()
.prop()
.removeAttr()
.removeProp()
.val()
CSS
.addClass()
.css()
jQuery.cssHooks
jQuery.cssNumber
jQuery.escapeSelector()
.hasClass()
.removeClass()
.toggleClass()
Dimensions
.height()
.innerHeight()
.innerWidth()
.outerHeight()
.outerWidth()
.width()
Offset
.offset()
.offsetParent()
.position()
.scrollLeft()
.scrollTop()
Data
jQuery.data()
.data()
jQuery.hasData()
jQuery.removeData()
.removeData()
of
5 13
MANIPULATION
Copying
.clone()
DOM Insertion, Around
.wrap()
.wrapAll()
.wrapInner()
DOM Insertion, Inside
.append()
.appendTo()
.html()
.prepend()
.prependTo()
.text()
DOM Insertion, Outside
.after()
.before()
.insertAfter()
.insertBefore()
DOM Removal
.detach()
.empty()
.remove()
.unwrap()
DOM Replacement
.replaceAll()
.replaceWith()
of
6 13
TRAVERSING
Filtering
.eq()
.filter()
.first()
.has()
.is()
.last()
.map()
.not()
.slice()
Miscellaneous Traversing
.add()
.addBack()
.andSelf()
.contents()
.each()
.end()
Tree Traversal
.children()
.closest()
.find()
.next()
.nextAll()
.nextUntil()
.parent()
.parents()
.parentsUntil()
.prev()
.prevAll()
.prevUntil()
.siblings()
of
7 13
EVENTS
Browser Events
.error()
.resize()
.scroll()
Document Loading
.load()
.ready()
.unload()
Event Handler Attachment
.bind()
.delegate()
.die()
.live()
.off()
.on()
.one()
.trigger()
.triggerHandler()
.unbind()
.undelegate()
Form Events
.blur()
.change()
.focus()
.focusin()
.focusout()
.select()
.submit()
Keyboard Events
.keydown()
.keypress()
.keyup()
Mouse Events
.click()
.contextMenu()
.dblclick()
.hover()
.mousedown()
.mouseenter()
.mouseleave()
.mousemove()
.mouseout()
.mouseover()
.mouseup()
.toggle()
Event Object
event.currentTarget
event.delegateTarget
of
8 13
event.data
event.isDefaultPrevented()
event.isImmediatePropagationStop
ped()
event.isPropagationStopped()
event.metaKey
event.namespace
event.pageX
event.pageY
event.preventDefault()
event.relatedTarget
event.result
event.stopImmediatePropagation()
event.stopPropagation()
event.target
event.timeStamp
event.type
event.which
of
9 13
EFFECTS
Basics
.hide()
.show()
.toggle()
Custom
.animate()
.clearQueue()
.delay()
.dequeue()
jQuery.dequeue()
.finish()
jQuery.fx.interval
jQuery.fx.off
jQuery.speed
.queue()
jQuery.queue()
.stop()
Fading
.fadeIn()
.fadeOut()
.fadeTo()
.fadeToggle()
Sliding
.slideDown()
.slideToggle()
.slideUp()
of
10 13
AJAX
Global Ajax Event Handlers
.ajaxComplete()
.ajaxError()
.ajaxSend()
.ajaxStart()
.ajaxStop()
.ajaxSuccess()
Helper Functions
jQuery.param()
.serialize()
.serializeArray()
Low-Level Interface
jQuery.ajax()
jQuery.prefilter()
jQuery.ajaxSetup()
jQuery.ajaxTransport()
Shorthand Methods
jQuery.get()
jQuery.getJSON()
jQuery.getScript()
jQuery.post()
.load()
of
11 13
CORE
jQuery Object
jQuery()
jQuery.noConflict()
jQuery.sub()
jQuery.holdReady()
jQuery.when()
Deferred Object
jQuery.Deferred()
deferred.always()
deferred.done()
deferred.fail()
deferred.isRejected()
deferred.isResolved()
deferred.notify()
deferred.notifyWith()
deferred.pipe()
deferred.progress()
deferred.promise()
deferred.reject()
deferred.rejectWith()
deferred.resolve()
deferred.resolveWith()
deferred.state()
deferred.then()
.promise()
Utilities
jQuery.boxModel
jQuery.browser
jQuery.contains()
jQuery.each()
jQuery.extend()
jQuery.globalEval()
jQuery.grep()
jQuery.inArray()
jQuery.isArray()
jQuery.isEmptyObject()
jQuery.isFunction()
jQuery.isNumeric()
jQuery.isPlainObject()
jQuery.isWindow()
jQuery.isXMLDoc()
jQuery.makeArray()
jQuery.map()
jQuery.merge()
jQuery.noop()
jQuery.now()
jQuery.parseHTML()
jQuery.parseJSON()
jQuery.parseXML()
jQuery.proxy()
of
12 13
jQuery.support
jQuery.trim()
jQuery.type()
jQuery.unique()
jQuery.uniqueSort()
DOM Element Methods
.get()
.index()
.size()
.toArray()
Internals
.jquery
.context
jQuery.error()
.length
.pushStack()
.selector
Callbacks Object
jQuery.Callbacks()
callbacks.add()
callbacks.disable()
callbacks.disabled()
callbacks.empty()
callbacks.fire()
callbacks.fired()
callbacks.fireWith()
callbacks.has()
callbacks.lock()
callbacks.locked()
callbacks.remove()
of
13 13

More Related Content

wsu-jquery-cheat-sheet.pdf