ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
jQuery 1.4 Cheat Sheet                                                                                                                                                                                          ImpulseStudios.ca
Core                                                Selectors                                         Effects                                           Events                                           Ajax
jQuery Function                                     Basic                                             Basics                                            Document Loading                                 Global Ajax Event Handlers
   $(selector, context)                   jQuery       *                                                 .hide(dur, cb)                       jQuery      .load(fn)                            jQuery       .ajaxComplete(cb)                     jQuery
   $(html, owner)                         jQuery       #id                                               .show(dur, cb)                       jQuery      .ready(fn)                           jQuery       .ajaxError(cb)                        jQuery
   $(callback)                            jQuery       element                                           .toggle(dur, cb)                     jQuery      .unload(fn)                          jQuery       .ajaxSend(cb)                         jQuery
No Conflict                                            .class                                            .toggle(showOrHide)                  jQuery    Event Handler Attachment                            .ajaxStart(cb)                        jQuery
                                                       selector, selectorN                            Fading                                              .bind(type, data, fn)                jQuery       .ajaxStop(cb)                         jQuery
   jQuery.noConflict(bool)                jQuery
                                                                                                         .fadeIn(dur, cb)                     jQuery      .bind(events)*                       jQuery       .ajaxSuccess(cb)                      jQuery
Attributes                                          Hierarchy
                                                       parent > child                                    .fadeOut(dur, cb)                    jQuery      .unbind(type, fn)                    jQuery    Helper Functions
General Attributes                                     ancestor descendant                               .fadeTo(dur, opacity, cb)            jQuery      .unbind(event)*                      jQuery       jQuery.param(obj, traditional)*        string
   .attr(attribute)                           obj      prev + next                                                                                        .live(type, data, fn)*               jQuery       .serialize()                           string
                                                                                                      Sliding
   .attr(attribute, val)                  jQuery                                                                                                          .die(type, fn)                       jQuery       .serialzeArray()                        array
                                                       prev ~ siblings                                   .slideUp(dur, cb)                    jQuery
   .attr(attribute, fn)                   jQuery                                                                                                          .one(type, data, fn)                 jQuery
                                                    Attribute                                            .slideDown(dur, cb)                  jQuery                                                     Low-Level Interface
   .removeAttr(attribute)                 jQuery                                                                                                          jQuery.proxy(fn, scope)*                 fn
                                                       [attribute|=val]                                  .slideToggle(dur, cb)                jQuery                                                        jQuery.ajax(settings)                   XHR
   .html()                                 string                                                                                                         jQuery.proxy(scope, name)*               fn
                                                       [attribute*=val]                                                                                                                                     jQuery.ajaxSetup(options)
   .html(string)                          jQuery                                                      Custom                                              .trigger(type, params)               jQuery
                                                       [attribute~=val]                                  .animate(prop, dur, easing, cb)      jQuery      .triggerHandler(type, params)           obj    Shorthand Methods
   .text()                                 string
                                                       [attribute$=val]                                  .animate(prop, options)              jQuery                                                        jQuery.get(url, data, cb, type)         XHR
   .text(string)                          jQuery                                                                                                        Browser Events
                                                       [attribute=val]                                   .delay(dur, queueName)*              jQuery                                                        jQuery.post(url, data, cb, type)        XHR
   .val()                           string, array                                                                                                         .error(fn)                           jQuery
                                                       [attribute!=val]                                  jQuery.fx.off                          bool                                                        jQuery.getJSON(url, data, cb)           XHR
   .val(value)                            jQuery                                                                                                          .resize(fn)                          jQuery
                                                       [attribute^=val]                                  .stop(clearQueue, jumpToEnd)         jQuery                                                        jQuery.getScript(url, cb)               XHR
                                                                                                                                                          .scroll(fn)                          jQuery
CSS                                                    [attribute]                                                                                                                                          .load(url, data, cb)                  jQuery
                                                       [attribute1=val1] [attribute2=val2]            Manipulation                                      Form Events
Style Properties                                                                                                                                          .blur(fn)                            jQuery    Traversing
   .css(property)                          string   Basic Filter                                      Copying
                                                                                                         .clone(withDataAndElements)          jQuery      .change(fn)                          jQuery    Tree Traversal
   .css(property, val|fn)*                jQuery       :animated
                                                                                                                                                          .focus(fn)                           jQuery       .children(selector)                   jQuery
                                                       :eq(index)                                     DOM Insertion, Around
Class Attribute                                                                                                                                           .select(fn)                          jQuery       .closest(selector, context)*          jQuery
                                                       :even                                             .wrap(element|fn)*                   jQuery
   .addClass(name|fn)*                    jQuery                                                                                                          .submit(fn)                          jQuery       .closest(selectors, context)*           array
                                                       :odd                                              .wrapAll(element)                    jQuery
   .removeClass(name|fn)*                 jQuery       :first                                                                                           Keyboard Events                                     .find(selector)                       jQuery
                                            bool                                                         .wrapInner(element|fn)*              jQuery
   .hasClass(name)                                     :last                                                                                              .focusin(fn)*                        jQuery       .next(selector)                       jQuery
                                          jQuery                                                         .unwrap()*                           jQuery
   .toggleClass(name|fn, switch)*                      :gt(index)                                                                                         .focusout(fn)*                       jQuery       .nextAll(selector)                    jQuery
Dimensions                                             :header                                        DOM Insertion, Inside                                                                                 .nextUntil(selector)*                 jQuery
                                                                                                                                                          .keydown(fn)                         jQuery
                                            int        :lt(index)                                        .append(content|fn)*                 jQuery                                                        .offsetParent()                       jQuery
   .height()                                                                                                                                              .keypress(fn)                        jQuery
                                         jQuery                                                          .appendTo(target)                    jQuery                                                        .parent(selector)                     jQuery
   .height(val)                                        :not(selector)                                                                                     .keyup(fn)                           jQuery
                                            int                                                          .prepend(content|fn)*                jQuery                                                        .parents(selector)                    jQuery
   .width()                                                                                                                                             Mouse Events
                                                    Content Filter                                       .prependTo(target)                   jQuery                                                        .parentsUntil(selector)*              jQuery
   .width(val)                           jQuery
                                                       :contains(text)                                                                                    .click(fn)                           jQuery
   .innerHeight()                           int                                                       DOM Insertion, Outside                                                                                .prev(selector)                       jQuery
                                                       :empty                                                                                             .dblclick(fn)                        jQuery
   .innerWidth()                            int                                                          .after(content|fn)*                  jQuery                                                        .prevAll(selector)                    jQuery
                                                       :has(selector)                                                                                     .hover(fn, fn)                       jQuery
   .outerHeight(margin)                     int                                                          .before(content|fn)*                 jQuery                                                        .prevUntil(selector)*                 jQuery
                                                       :parent                                                                                            .mousedown(fn)                       jQuery
   .outerWidth(margin)                      int                                                          .insertAfter()                       jQuery                                                        .siblings(selector)                   jQuery
                                                                                                                                                          .mouseenter(fn)                      jQuery
                                                    Visibility Filter                                    .insertBefore()                      jQuery                                                     Filtering
Offset                                                                                                                                                    .mouseleave(fn)                      jQuery
                                                       :hidden                                        DOM Removal                                         .mousemove(fn)                       jQuery       .eq(index)                            jQuery
   .offset()                        obj{top,left}
                                                       :visible                                          .detach(selector)*                   jQuery      .mouseout(fn)                        jQuery       .filter(selector)                     jQuery
   .offset(coordinates)*                      obj
   .position()                      obj{top,left}   Child Filter                                         .empty()                             jQuery      .mouseover(fn)                       jQuery       .filter(fn)                           jQuery
   .scrollLeft()                              int      :first-child                                      .remove(selector)                    jQuery      .mouseup(fn)                         jQuery       .first()                              jQuery
   .scrollLeft(val)                       jQuery       :last-child                                    DOM Replacement                                                                                       .last()                               jQuery
                                                                                                                                                        Event Object
   .scrollTop()                               int      :nth-child(index/even/odd/eq)                                                                                                                        .has(selector)*                       jQuery
                                                                                                         .replaceAll()                        jQuery      event.currentTarget               element
   .scrollLeft(val)                       jQuery       :only-child                                                                                                                                          .has(contained)*                      jQuery
                                                                                                         .replaceWith(content|fn)*            jQuery      event.data                       anything
                                                    Form                                                                                                                                                    .is(selector)                         jQuery
Data                                                                                                                                                      event.isDefaultPrevented()            bool
                                                       :button                                        Utilities                                           event.isImmediatePropagationStopped()bool
                                                                                                                                                                                                            .map(cb)                              jQuery
   jQuery.data(element, key, value)       jQuery                                                         jQuery.contains(container, contained)* bool                                                        .not(selector)                        jQuery
                                                       :checkbox                                                                                          event.isPropagationStopped()          bool
   jQuery.data(element, key)                  obj                                                        jQuery.each(obj, fn)                     obj                                                       .not(elements)                        jQuery
                                                       :checked                                                                                           event.pageX                           num
   .queue(queueName)                        array                                                        jQuery.extend(deep, target, obj, objN) obj                                                         .not(fn)                              jQuery
                                                       :disabled                                                                                          event.pageY                           num
   .queue(queueName, newQueue|cb)         jQuery                                                         jQuery.globalEval(code)
                                                       :enabled                                                                                           event.preventDefault                           Miscellaneous Traversing
   .clearQueue(queueName)*                jQuery                                                         jQuery.grep(array, fn, invert)         array
                                                       :file                                                                                              event.relatedTarget               element         .add(selector)                        jQuery
   .dequeue(queueName)                    jQuery                                                         jQuery.inArray(val, array)             num
                                                       :image                                                                                             event.result                            obj       .add(elements)                        jQuery
Miscellaneous                                          :input                                            jQuery.isArray(obj)                    bool      event.stopImmediatePropagation()                  .add(html)                            jQuery
                                                       :password                                         jQuery.isEmptyObject(obj)*             bool      event.target                      element         .add(selector, context)*              jQuery
Collection Manipulation                                :radio                                            jQuery.isFunction()                    bool      event.timeStamp                       num         .andSelf()                            jQuery
   .each(fn)                              jQuery       :reset                                            jQuery.isPlainObject(obj)*             bool      event.type                           string       .contents()                           jQuery
Collection Manipulation                                :selected                                         jQuery.isXMLDoc(node)                  bool      event.which                          string       .end()                                jQuery
   .get(index)                  element, array         :submit                                           jQuery.makeArray(obj)                  array
   .index(selector|element)*             num           :text                                             jQuery.map(array, cb)                  array   Legend
   .size()                               num                                                             jQuery.merge(array1, array2)           array     light text               optional parameter       cb                                   callback
                                                    Properties of the Global jQuery Object
   .toArray()*                           array                                                           jQuery.noop*                              fn     item|item                                 or      num                                  number
                                                       jQuery.support                           obj
                                                                                                         jQuery.trim()                         string     obj                                   object      val                                     value
                                                       jQuery.browser                         map
                                                                                                         jQuery.unique(array)                   array     bool                                boolean       dur                                 duration
                                                       jQuery.browser.version                string
                                                                                                                                                          fn                                  function      *                       new or updated in 1.4

More Related Content

Jquery14

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