Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Jquery cheat-sheet-1.2

708 views

Published on

  • Be the first to comment

  • Be the first to like this

Jquery cheat-sheet-1.2

  1. 1. Constructor Setter Method Getter Method Property Function $ Jquery 1.2 Boolean, Integer, String, Array, Object, Function, DOM|XML Element(s), HttpRequest, Jquery Left signs colors give the return type, light red ones (returning jquery objects) are chainable. Core CSS Attributes Effects $( html ) css( name ) addClass( class ) animate( style(3), [speed|speed][, easing][, callback] ) $( elements(0) ) css( style(3) ) attr( name ) animate( style(3), options(5) ) $( selector[, context(0)] ) css( key, value ) attr( attributes(2) ) dequeue() $( docReady ) height() attr( key, value|mapper ) fadeIn( [speed|speed][, callback] ) $ $.extend( properties(1) ) height( value ) html() fadeOut( [speed|speed][, callback] ) $ $.fn.extend( properties(1) ) offset() html( value ) fadeTo( speed|speed, opacity[, callback] ) $ $.noConflict( extreme ) width() removeAttr( name ) hide( [speed|speed][, callback] ) data( element ) width( value ) removeClass( class ) queue() data( element, name ) text() queue( callback|callbacks ) data( element, name, value|value|value... ) Manipulation text( value ) show( [speed|speed][, callback] ) each( mapper ) after( html|elements(0) ) toggleClass( class ) slideDown( [speed|speed][, callback] ) get() append( html|elements(0) ) val() | val() slideToggle( [speed|speed][, callback] ) get( positon ) appendTo( html|elements(0) ) val( value|value ) slideUp( [speed|speed][, callback] ) index( element ) before( html|elements(0) ) stop() length clone( events ) Events toggle() removeData( element ) empty() bind( type[, data(4)], handler ) removeData( element, name ) insertAfter( html|elements(0) ) blur() Ajax size() insertBefore( html|elements(0) ) blur( handler ) $.ajax( settings(6) ) prepend( html|elements(0) ) change( handler ) $.ajaxSetup( settings(6) ) Selectors (E,F,G are tagNames) prependTo( html|elements(0) ) click() $.get( url[, parameters(7)][, callback] ) * remove( [selector] ) click( handler ) $.getJSON( url[, parameters(7)], callback ) E E:even replaceWith( html|element(0) ) dblclick( handler ) $.getScript( url[, callback] ) EF E:file replaceAll( html|elements(0) ) error( handler ) $.post( url[, parameters(7)][, callback] ) E>F E:first wrap( html|element(0) ) focus() ajaxComplete( callback ) E+F E:first-child wrapAll( html|element(0) ) focus( handler ) ajaxError( callback ) E~F E:gt( positon ) wrapInner( html|element(0) ) hover( over, out ) ajaxSend( callback ) E,F,G E:has( selector ) keydown( handler ) ajaxStart( callback ) E[@attribute] E:header Traversing keypress( handler ) ajaxStop( callback ) E[@attribute=value] E:hidden add( selector|html|elements(0) ) keyup( handler ) ajaxSuccess( callback ) E[@attribute^=value] E:image andSelf() load( handler ) load( url [selector][, parameters(7)][, callback] ) E[@attribute$=value] E:input children( selector ) mousedown( handler ) serialize() E[@attribute*=value] E:last contains( text ) mousemove( handler ) serializeArray() E[@attribute~=value] E:last-child contents() mouseout( handler ) E[@attribute!=value] E:lt( positon ) end() mouseover( handler ) JavaScript E[attribute] E:not( selector ) filter( selector|filter ) mouseup( handler ) $.browser E#id E:nth-child( num|expr ) find( selector ) one( type[, data(4)], handler ) $.browser.version E.class E:odd hasClass( class ) ready( handler ) $.each( object(1), mapper ) E:animated E:only-child is( selector ) resize( handler ) $.extend( target(1), properties(1)[, properties(1)...] ) E:button E:parent map( mapper ) scroll( handler ) $.grep( array, mapper[, inverse] ) E:checkbox E:password next( selector ) select() $.map( array, mapper ) E:checked E:radio nextAll( selector ) select( handler ) $.merge( first, second ) E:contains( text ) E:reset not( selector|elements(0) ) submit() $.trim( string ) E:disabled E:selected parent( selector ) submit( handler ) $.unique( array ) E:empty E:submit parents( selector ) toggle( even, odd ) E:enabled E:text prev( selector ) trigger( type [, data(4)] ) E:eq( positon ) E:visible prevAll( selector ) triggerHandler( type [, data(4)] ) siblings( selector ) unbind( [type][, handler] ) slice( positon[, positon] ) unload( handler ) (0) (1) Any Object { key:value|value|value|value|..., ... }, extends included objects recursivly. $.fn format is { name:plugin, ... } single or array of DOM|XML Elements as well as Jquery Object. (2) (3) CSS Style { camelCasedName:value, ... }, for animate values can be relative (%, em, +50px) (X)Html Attribute { name:value|value, ... } (4) Data sent to function as event.data, any Object, format like (1) (5) Animation options { [duration|duration:slow|normal|fast][, easing:linear|swing|pluginEasing][, complete][, step][, queue] } (6) Ajax Settings { [url][, cache][, type:GET|POST][, dataType:xml|html|script|json][, ifModified][, timeout][, global][, error][, success][, complete][, data|data][, contentType][, processData][, async][, beforeSend] } (7) Parameters sent to server { key:value|value|value|value|value, ... }

×