Embed
Email

jQuery1.2 cheatsheet.v1.0

Document Sample
jQuery1.2 cheatsheet.v1.0
Shared by: Jigar Chauhan
Stats
views:
106
posted:
8/27/2009
language:
English
pages:
1
jQuery 1.2 Cheat Sheet v1.0


CORE

$(...) The jQuery Function: jQuery( expr, context )
jQuery jQuery( html )
jQuery jQuery( elements )
jQuery jQuery( cb )
jQuery jQuery Object Accessors: each( cb )
jQuery size( )
Number length
Number eq( position )
jQuery get( )
Array get( index )
Element index( subject )
Number Plugins: jQuery.fn.extend( object )
jQuery jQuery.extend( object )
jQuery Interoperability: jQuery.noConflict( )
jQuery jQuery.noConflict( extreme )
jQuery



gscottolson.com/weblog/

MANIPULATION

Changing Contents: html( )
html( val )
text( )
text( val )
Inserting Inside: append( content )
appendTo( content )
prepend( content )
prependTo( content )
Inserting Outside: after( content )
before( content )
insertAfter( content )
insertBefore( content )
Inserting Around: wrap( html )
wrap( elem )
wrapAll( html )
wrapAll( elem )
wrapInner( html )
wrapInner( elem )
Replacing: replaceWith( content )
replaceAll( selector )
Removing: empty( )
remove( expr )
Copying: clone( )
clone( true )
String jQuery String jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery



SELECTORS



ATTRIBUTES



Attr: attr( name )
attr( properties )
attr( key, value )
attr( key, fn )
removeAttr( name )
Class: addClass( class )
removeClass( class )
toggleClass( class )
HTML: html( )
html( val )
Text: text( )
text( val )
Value: val( )
val( val )
val( val )




Object jQuery jQuery jQuery jQuery jQuery jQuery jQuery String jQuery String jQuery String, Array jQuery jQuery



CSS



CSS: css( name )
css( properties )
css( name, value )
Positioning: offset( )
Height and Width: height( )
height( val )
width( )
width( val )




String jQuery jQuery Object{top,left} Integer jQuery Integer jQuery



Basics: #id
Element element
Array .class
Array *
Array selector1, selectorN
Array Hierarchy: ancestor descendant
Array parent > child
Array prev + next
Array prev ~ siblings
Array Basic Filters: :first
Element :last
Element :not(selector)
Array :even
Array :odd
Array :eq(index)
Element :gt(index)
Array :lt(index)
Array :header
Array :animated
Array Content Filters: :contains(text)
Array :empty
Array :has(selector)
Array :parent
Array Visibility Filters: :hidden
Array :visible
Array Attribute Filters: [attribute]
Array [attribute=value]
Array [attribute!=value]
Array [attribute^=value]
Array [attribute$=value]
Array [attribute*=value]
Array [selector1][selectorN]
Array Child Filters: :nth-child(idx/even/odd/eq)
Array :first-child
Array :last-child
Array :only-child
Array Forms: :input
Array :text
Array :password
Array :radio
Array :checkbox
Array :submit
Array :image
Array :reset
Array :button
Array :file
Array :hidden
Array Form Filters: :enabled
Array :disabled
Array :checked
Array :selected
Array



EVENTS



Page Load: ready( fn )
Event Handling:
bind( type, data, fn )
one( type, data, fn )
trigger( type, data )
triggerHandler( type, data )
unbind( type, data )
Interaction Helpers:
hover( over, out )
toggle( fn, fn )
Event Helpers: blur( [fn] )
change( [fn] )
click( [fn] )
dblclick( [fn] )
error( [fn] )
focus( [fn] )
keydown( [fn] )
keypress( [fn] )
keyup( [fn] )
load( fn )
mousedown( fn )
mousemove( fn )
mouseout( fn )
mouseover( fn )
mouseup( fn )
resize( fn )
scroll( fn )
select( [fn] )
submit( [fn] )
unload( fn )




AJAX

jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery



Ajax Requests: jQuery.ajax( options )
load( url, data, cb )
jQuery.get( url, data, cb )
jQuery.getJSON( url, data, cb )
jQuery.getScript( url, cb )
jQuery.post( url, data, cb, type )
Ajax Events: ajaxComplete( cb )
ajaxError( cb )
ajaxSend( cb )
ajaxStart( cb )
ajaxStop( cb )
ajaxSuccess( cb )
Misc: jQuery.ajaxSetup( options )
serialize( )
serializeArray( )




XHR jQuery XHR XHR XHR XHR jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery



UTILITIES



TRAVERSING

Filtering: eq( index )
hasClass( class )
filter( expr )
filter( fn )
is( expr )
map( cb )
not( expr )
slice( start, end )
Finding: add( expr )
children( expr )
contents( )
find( expr )
next( expr )
nextAll( expr )
parent( expr )
parents( expr )
prev( expr )
prevAll( expr )
siblings( expr )
Chaining: andSelf( )
end( )
jQuery Boolean jQuery jQuery Boolean jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery jQuery



EFFECTS



Basics: show( [speed, cb] )
jQuery hide( [speed, cb] )
jQuery toggle( )
jQuery Sliding: slideDown( speed, cb )
jQuery slideUp( speed, cb )
jQuery slideToggle( speed, cb )
jQuery Fading: fadeIn( speed, cb )
jQuery fadeOut( speed, cb )
jQuery fadeTo( speed, opacity, cb )
jQuery Custom: animate( params, dur, easing, cb )
jQuery animate( params, options )
jQuery stop( )
jQuery queue( )
Array queue( cb )
jQuery queue( queue )
jQuery dequeue( )
jQuery



jQuery.browser
Map jQuery.browser.version
String jQuery.boxModel
Boolean Array and Object operations: jQuery.each( object, cb )
Object jQuery.extend( target, obj1, objN )
Object jQuery.grep( arr, cb, invert )
Array jQuery.makeArray( obj )
Array jQuery.map( arr, cb )
Array jQuery.inArray( value, arr )
Number jQuery.unique( arr )
Array Test operations: jQuery.isFunction( obj )
Boolean String operations: jQuery.trim( str )
String



Key: cb = callback dur = duration idx = index eq = equation XHR = XmlHTTPRequest arr = array [fn] = optional function





Other docs by Jigar Chauhan
JavaScript cheat sheet V1
Views: 56  |  Downloads: 6
ruby-on-rails-cheat-sheet-v1
Views: 64  |  Downloads: 4
Ruby on Rails : active record cheat sheet
Views: 125  |  Downloads: 17
SEO Web Developer CheatSheet
Views: 41  |  Downloads: 7
Ruby on Rails for PHP and Java Developers
Views: 2308  |  Downloads: 55
jQuery1.2 cheatsheet.v1.0
Views: 106  |  Downloads: 4
64 CSS Cheats
Views: 103  |  Downloads: 5
CSS Cheatsheet Version 2
Views: 63  |  Downloads: 23
Rails Files Cheatsheet
Views: 57  |  Downloads: 5
Mobile Web Design Guide
Views: 567  |  Downloads: 85
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!