Docsity

jQuery Cheat Sheet for Rapid Web Development, Lecture notes of Javascript programming

Partial preview of the text

Download jQuery Cheat Sheet for Rapid Web Development and more Lecture notes Javascript programming in PDF only on Docsity!

Beginner’s essential

jQuery Cheat Sheet

Write less, and do more!

An essential tool for rapid web development.

#################

TABLE OF CONTENTS

  • Selectors
  • Attributes / CSS
  • Manipulation
  • Traversing
  • Events
  • Effects
  • AJAX
  • Core

: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

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()

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()

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

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()

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()

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()