Updated the docs for a number of methods.

This commit is contained in:
John Resig 2006-08-12 23:08:44 +00:00
parent db85661c05
commit 6a47e28340
4 changed files with 261 additions and 21 deletions

View file

@ -1,13 +1,13 @@
<html> <html>
<head> <head>
<title>jQuery Documentation</title> <title>jQuery Documentation</title>
<link rel="stylesheet" href="style.css"/> <link rel="stylesheet" href="style/style.css"/>
<script src="../jquery-svn.js"></script> <script src="../jquery-svn.js"></script>
<script src="tooltip.js"></script> <script src="js/tooltip.js"></script>
<script src="pager.js"></script> <script src="js/pager.js"></script>
<script src="jsont.js"></script> <script src="js/jsont.js"></script>
<script src="doc.js"></script> <script src="js/doc.js"></script>
<script src="jquery-docs-jsonp.js"></script> <script src="data/jquery-docs-jsonp.js"></script>
</head> </head>
<body> <body>
<h1>jQuery Docs &raquo; API</h1> <h1>jQuery Docs &raquo; API</h1>

View file

@ -20,6 +20,7 @@ jQuery.fn.extend({
* @type jQuery * @type jQuery
* @param Function even The function to execute on every even click. * @param Function even The function to execute on every even click.
* @param Function odd The function to execute on every odd click. * @param Function odd The function to execute on every odd click.
* @cat Events
*/ */
toggle: function(a,b) { toggle: function(a,b) {
// If two functions are passed in, we're // If two functions are passed in, we're
@ -62,6 +63,7 @@ jQuery.fn.extend({
* @type jQuery * @type jQuery
* @param Function over The function to fire whenever the mouse is moved over a matched element. * @param Function over The function to fire whenever the mouse is moved over a matched element.
* @param Function out The function to fire whenever the mouse is moved off of a matched element. * @param Function out The function to fire whenever the mouse is moved off of a matched element.
* @cat Events
*/ */
hover: function(f,g) { hover: function(f,g) {
@ -95,7 +97,7 @@ jQuery.fn.extend({
* will be called the instant the DOM is ready to be read and manipulated, * will be called the instant the DOM is ready to be read and manipulated,
* which is exactly what 99.99% of all Javascript code needs to run. * which is exactly what 99.99% of all Javascript code needs to run.
* *
* Please ensure you have no code in your <body> onload event handler, * Please ensure you have no code in your &lt;body&gt; onload event handler,
* otherwise $(document).ready() may not fire. * otherwise $(document).ready() may not fire.
* *
* @example $(document).ready(function(){ Your code here... }); * @example $(document).ready(function(){ Your code here... });
@ -103,6 +105,7 @@ jQuery.fn.extend({
* @name ready * @name ready
* @type jQuery * @type jQuery
* @param Function fn The function to be executed when the DOM is ready. * @param Function fn The function to be executed when the DOM is ready.
* @cat Events
*/ */
ready: function(f) { ready: function(f) {
// If the DOM is already ready // If the DOM is already ready
@ -159,6 +162,7 @@ new function(){
* @name blur * @name blur
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the blur event on each of the matched elements. * @param Function fn A function to bind to the blur event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -171,6 +175,7 @@ new function(){
* *
* @name blur * @name blur
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -185,6 +190,7 @@ new function(){
* @name oneblur * @name oneblur
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the blur event on each of the matched elements. * @param Function fn A function to bind to the blur event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -199,6 +205,7 @@ new function(){
* @name unblur * @name unblur
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the blur event on each of the matched elements. * @param Function fn A function to unbind from the blur event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -210,6 +217,7 @@ new function(){
* *
* @name unblur * @name unblur
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -222,6 +230,7 @@ new function(){
* @name focus * @name focus
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the focus event on each of the matched elements. * @param Function fn A function to bind to the focus event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -234,6 +243,7 @@ new function(){
* *
* @name focus * @name focus
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -248,6 +258,7 @@ new function(){
* @name onefocus * @name onefocus
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the focus event on each of the matched elements. * @param Function fn A function to bind to the focus event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -262,6 +273,7 @@ new function(){
* @name unfocus * @name unfocus
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the focus event on each of the matched elements. * @param Function fn A function to unbind from the focus event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -273,6 +285,7 @@ new function(){
* *
* @name unfocus * @name unfocus
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -285,6 +298,7 @@ new function(){
* @name load * @name load
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the load event on each of the matched elements. * @param Function fn A function to bind to the load event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -297,6 +311,7 @@ new function(){
* *
* @name load * @name load
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -311,6 +326,7 @@ new function(){
* @name oneload * @name oneload
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the load event on each of the matched elements. * @param Function fn A function to bind to the load event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -325,6 +341,7 @@ new function(){
* @name unload * @name unload
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the load event on each of the matched elements. * @param Function fn A function to unbind from the load event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -336,6 +353,7 @@ new function(){
* *
* @name unload * @name unload
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -348,6 +366,7 @@ new function(){
* @name resize * @name resize
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the resize event on each of the matched elements. * @param Function fn A function to bind to the resize event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -360,6 +379,7 @@ new function(){
* *
* @name resize * @name resize
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -374,6 +394,7 @@ new function(){
* @name oneresize * @name oneresize
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the resize event on each of the matched elements. * @param Function fn A function to bind to the resize event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -388,6 +409,7 @@ new function(){
* @name unresize * @name unresize
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the resize event on each of the matched elements. * @param Function fn A function to unbind from the resize event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -399,6 +421,7 @@ new function(){
* *
* @name unresize * @name unresize
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -411,6 +434,7 @@ new function(){
* @name scroll * @name scroll
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the scroll event on each of the matched elements. * @param Function fn A function to bind to the scroll event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -423,6 +447,7 @@ new function(){
* *
* @name scroll * @name scroll
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -437,6 +462,7 @@ new function(){
* @name onescroll * @name onescroll
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the scroll event on each of the matched elements. * @param Function fn A function to bind to the scroll event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -451,6 +477,7 @@ new function(){
* @name unscroll * @name unscroll
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the scroll event on each of the matched elements. * @param Function fn A function to unbind from the scroll event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -462,6 +489,7 @@ new function(){
* *
* @name unscroll * @name unscroll
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -474,6 +502,7 @@ new function(){
* @name unload * @name unload
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the unload event on each of the matched elements. * @param Function fn A function to bind to the unload event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -486,6 +515,7 @@ new function(){
* *
* @name unload * @name unload
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -500,6 +530,7 @@ new function(){
* @name oneunload * @name oneunload
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the unload event on each of the matched elements. * @param Function fn A function to bind to the unload event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -514,6 +545,7 @@ new function(){
* @name ununload * @name ununload
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the unload event on each of the matched elements. * @param Function fn A function to unbind from the unload event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -525,6 +557,7 @@ new function(){
* *
* @name ununload * @name ununload
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -537,6 +570,7 @@ new function(){
* @name click * @name click
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the click event on each of the matched elements. * @param Function fn A function to bind to the click event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -549,6 +583,7 @@ new function(){
* *
* @name click * @name click
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -563,6 +598,7 @@ new function(){
* @name oneclick * @name oneclick
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the click event on each of the matched elements. * @param Function fn A function to bind to the click event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -577,6 +613,7 @@ new function(){
* @name unclick * @name unclick
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the click event on each of the matched elements. * @param Function fn A function to unbind from the click event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -588,6 +625,7 @@ new function(){
* *
* @name unclick * @name unclick
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -600,6 +638,7 @@ new function(){
* @name dblclick * @name dblclick
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the dblclick event on each of the matched elements. * @param Function fn A function to bind to the dblclick event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -612,6 +651,7 @@ new function(){
* *
* @name dblclick * @name dblclick
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -626,6 +666,7 @@ new function(){
* @name onedblclick * @name onedblclick
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the dblclick event on each of the matched elements. * @param Function fn A function to bind to the dblclick event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -640,6 +681,7 @@ new function(){
* @name undblclick * @name undblclick
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the dblclick event on each of the matched elements. * @param Function fn A function to unbind from the dblclick event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -651,6 +693,7 @@ new function(){
* *
* @name undblclick * @name undblclick
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -663,6 +706,7 @@ new function(){
* @name mousedown * @name mousedown
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the mousedown event on each of the matched elements. * @param Function fn A function to bind to the mousedown event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -675,6 +719,7 @@ new function(){
* *
* @name mousedown * @name mousedown
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -689,6 +734,7 @@ new function(){
* @name onemousedown * @name onemousedown
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the mousedown event on each of the matched elements. * @param Function fn A function to bind to the mousedown event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -703,6 +749,7 @@ new function(){
* @name unmousedown * @name unmousedown
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the mousedown event on each of the matched elements. * @param Function fn A function to unbind from the mousedown event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -714,6 +761,7 @@ new function(){
* *
* @name unmousedown * @name unmousedown
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -726,6 +774,7 @@ new function(){
* @name mouseup * @name mouseup
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the mouseup event on each of the matched elements. * @param Function fn A function to bind to the mouseup event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -738,6 +787,7 @@ new function(){
* *
* @name mouseup * @name mouseup
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -752,6 +802,7 @@ new function(){
* @name onemouseup * @name onemouseup
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the mouseup event on each of the matched elements. * @param Function fn A function to bind to the mouseup event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -766,6 +817,7 @@ new function(){
* @name unmouseup * @name unmouseup
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the mouseup event on each of the matched elements. * @param Function fn A function to unbind from the mouseup event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -777,6 +829,7 @@ new function(){
* *
* @name unmouseup * @name unmouseup
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -789,6 +842,7 @@ new function(){
* @name mousemove * @name mousemove
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the mousemove event on each of the matched elements. * @param Function fn A function to bind to the mousemove event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -801,6 +855,7 @@ new function(){
* *
* @name mousemove * @name mousemove
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -815,6 +870,7 @@ new function(){
* @name onemousemove * @name onemousemove
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the mousemove event on each of the matched elements. * @param Function fn A function to bind to the mousemove event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -829,6 +885,7 @@ new function(){
* @name unmousemove * @name unmousemove
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the mousemove event on each of the matched elements. * @param Function fn A function to unbind from the mousemove event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -840,6 +897,7 @@ new function(){
* *
* @name unmousemove * @name unmousemove
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -852,6 +910,7 @@ new function(){
* @name mouseover * @name mouseover
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the mouseover event on each of the matched elements. * @param Function fn A function to bind to the mouseover event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -864,6 +923,7 @@ new function(){
* *
* @name mouseover * @name mouseover
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -878,6 +938,7 @@ new function(){
* @name onemouseover * @name onemouseover
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the mouseover event on each of the matched elements. * @param Function fn A function to bind to the mouseover event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -892,6 +953,7 @@ new function(){
* @name unmouseover * @name unmouseover
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the mouseover event on each of the matched elements. * @param Function fn A function to unbind from the mouseover event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -903,6 +965,7 @@ new function(){
* *
* @name unmouseover * @name unmouseover
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -915,6 +978,7 @@ new function(){
* @name mouseout * @name mouseout
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the mouseout event on each of the matched elements. * @param Function fn A function to bind to the mouseout event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -927,6 +991,7 @@ new function(){
* *
* @name mouseout * @name mouseout
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -941,6 +1006,7 @@ new function(){
* @name onemouseout * @name onemouseout
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the mouseout event on each of the matched elements. * @param Function fn A function to bind to the mouseout event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -955,6 +1021,7 @@ new function(){
* @name unmouseout * @name unmouseout
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the mouseout event on each of the matched elements. * @param Function fn A function to unbind from the mouseout event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -966,6 +1033,7 @@ new function(){
* *
* @name unmouseout * @name unmouseout
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -978,6 +1046,7 @@ new function(){
* @name change * @name change
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the change event on each of the matched elements. * @param Function fn A function to bind to the change event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -990,6 +1059,7 @@ new function(){
* *
* @name change * @name change
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1004,6 +1074,7 @@ new function(){
* @name onechange * @name onechange
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the change event on each of the matched elements. * @param Function fn A function to bind to the change event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1018,6 +1089,7 @@ new function(){
* @name unchange * @name unchange
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the change event on each of the matched elements. * @param Function fn A function to unbind from the change event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1029,6 +1101,7 @@ new function(){
* *
* @name unchange * @name unchange
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1041,6 +1114,7 @@ new function(){
* @name reset * @name reset
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the reset event on each of the matched elements. * @param Function fn A function to bind to the reset event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1053,6 +1127,7 @@ new function(){
* *
* @name reset * @name reset
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1067,6 +1142,7 @@ new function(){
* @name onereset * @name onereset
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the reset event on each of the matched elements. * @param Function fn A function to bind to the reset event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1081,6 +1157,7 @@ new function(){
* @name unreset * @name unreset
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the reset event on each of the matched elements. * @param Function fn A function to unbind from the reset event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1092,6 +1169,7 @@ new function(){
* *
* @name unreset * @name unreset
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1104,6 +1182,7 @@ new function(){
* @name select * @name select
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the select event on each of the matched elements. * @param Function fn A function to bind to the select event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1116,6 +1195,7 @@ new function(){
* *
* @name select * @name select
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1130,6 +1210,7 @@ new function(){
* @name oneselect * @name oneselect
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the select event on each of the matched elements. * @param Function fn A function to bind to the select event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1144,6 +1225,7 @@ new function(){
* @name unselect * @name unselect
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the select event on each of the matched elements. * @param Function fn A function to unbind from the select event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1155,6 +1237,7 @@ new function(){
* *
* @name unselect * @name unselect
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1167,6 +1250,7 @@ new function(){
* @name submit * @name submit
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the submit event on each of the matched elements. * @param Function fn A function to bind to the submit event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1179,6 +1263,7 @@ new function(){
* *
* @name submit * @name submit
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1193,6 +1278,7 @@ new function(){
* @name onesubmit * @name onesubmit
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the submit event on each of the matched elements. * @param Function fn A function to bind to the submit event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1207,6 +1293,7 @@ new function(){
* @name unsubmit * @name unsubmit
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the submit event on each of the matched elements. * @param Function fn A function to unbind from the submit event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1218,6 +1305,7 @@ new function(){
* *
* @name unsubmit * @name unsubmit
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1230,6 +1318,7 @@ new function(){
* @name keydown * @name keydown
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the keydown event on each of the matched elements. * @param Function fn A function to bind to the keydown event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1242,6 +1331,7 @@ new function(){
* *
* @name keydown * @name keydown
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1256,6 +1346,7 @@ new function(){
* @name onekeydown * @name onekeydown
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the keydown event on each of the matched elements. * @param Function fn A function to bind to the keydown event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1270,6 +1361,7 @@ new function(){
* @name unkeydown * @name unkeydown
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the keydown event on each of the matched elements. * @param Function fn A function to unbind from the keydown event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1281,6 +1373,7 @@ new function(){
* *
* @name unkeydown * @name unkeydown
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1293,6 +1386,7 @@ new function(){
* @name keypress * @name keypress
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the keypress event on each of the matched elements. * @param Function fn A function to bind to the keypress event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1305,6 +1399,7 @@ new function(){
* *
* @name keypress * @name keypress
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1319,6 +1414,7 @@ new function(){
* @name onekeypress * @name onekeypress
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the keypress event on each of the matched elements. * @param Function fn A function to bind to the keypress event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1333,6 +1429,7 @@ new function(){
* @name unkeypress * @name unkeypress
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the keypress event on each of the matched elements. * @param Function fn A function to unbind from the keypress event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1344,6 +1441,7 @@ new function(){
* *
* @name unkeypress * @name unkeypress
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1356,6 +1454,7 @@ new function(){
* @name keyup * @name keyup
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the keyup event on each of the matched elements. * @param Function fn A function to bind to the keyup event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1368,6 +1467,7 @@ new function(){
* *
* @name keyup * @name keyup
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1382,6 +1482,7 @@ new function(){
* @name onekeyup * @name onekeyup
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the keyup event on each of the matched elements. * @param Function fn A function to bind to the keyup event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1396,6 +1497,7 @@ new function(){
* @name unkeyup * @name unkeyup
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the keyup event on each of the matched elements. * @param Function fn A function to unbind from the keyup event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1407,6 +1509,7 @@ new function(){
* *
* @name unkeyup * @name unkeyup
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1419,6 +1522,7 @@ new function(){
* @name error * @name error
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the error event on each of the matched elements. * @param Function fn A function to bind to the error event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1431,6 +1535,7 @@ new function(){
* *
* @name error * @name error
* @type jQuery * @type jQuery
* @cat Events
*/ */
/** /**
@ -1445,6 +1550,7 @@ new function(){
* @name oneerror * @name oneerror
* @type jQuery * @type jQuery
* @param Function fn A function to bind to the error event on each of the matched elements. * @param Function fn A function to bind to the error event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1459,6 +1565,7 @@ new function(){
* @name unerror * @name unerror
* @type jQuery * @type jQuery
* @param Function fn A function to unbind from the error event on each of the matched elements. * @param Function fn A function to unbind from the error event on each of the matched elements.
* @cat Events
*/ */
/** /**
@ -1470,6 +1577,7 @@ new function(){
* *
* @name unerror * @name unerror
* @type jQuery * @type jQuery
* @cat Events
*/ */
var e = ("blur,focus,load,resize,scroll,unload,click,dblclick," + var e = ("blur,focus,load,resize,scroll,unload,click,dblclick," +

View file

@ -13,6 +13,7 @@ jQuery.fn.extend({
* @name show * @name show
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @cat Effects/Animations
*/ */
/** /**
@ -29,6 +30,7 @@ jQuery.fn.extend({
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @param Function callback A function to be executed whenever the animation completes. * @param Function callback A function to be executed whenever the animation completes.
* @cat Effects/Animations
*/ */
show: function(speed,callback){ show: function(speed,callback){
return speed ? this.animate({ return speed ? this.animate({
@ -49,6 +51,7 @@ jQuery.fn.extend({
* @name hide * @name hide
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @cat Effects/Animations
*/ */
/** /**
@ -65,6 +68,7 @@ jQuery.fn.extend({
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @param Function callback A function to be executed whenever the animation completes. * @param Function callback A function to be executed whenever the animation completes.
* @cat Effects/Animations
*/ */
hide: function(speed,callback){ hide: function(speed,callback){
return speed ? this.animate({ return speed ? this.animate({
@ -82,6 +86,7 @@ jQuery.fn.extend({
* @name slideDown * @name slideDown
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @cat Effects/Animations
*/ */
/** /**
@ -98,6 +103,7 @@ jQuery.fn.extend({
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @param Function callback A function to be executed whenever the animation completes. * @param Function callback A function to be executed whenever the animation completes.
* @cat Effects/Animations
*/ */
slideDown: function(speed,callback){ slideDown: function(speed,callback){
return this.animate({height: "show"}, speed, callback); return this.animate({height: "show"}, speed, callback);
@ -113,6 +119,7 @@ jQuery.fn.extend({
* @name slideUp * @name slideUp
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @cat Effects/Animations
*/ */
/** /**
@ -129,6 +136,7 @@ jQuery.fn.extend({
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @param Function callback A function to be executed whenever the animation completes. * @param Function callback A function to be executed whenever the animation completes.
* @cat Effects/Animations
*/ */
slideUp: function(speed,callback){ slideUp: function(speed,callback){
return this.animate({height: "hide"}, speed, callback); return this.animate({height: "hide"}, speed, callback);
@ -145,6 +153,7 @@ jQuery.fn.extend({
* @name fadeIn * @name fadeIn
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @cat Effects/Animations
*/ */
/** /**
@ -162,6 +171,7 @@ jQuery.fn.extend({
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @param Function callback A function to be executed whenever the animation completes. * @param Function callback A function to be executed whenever the animation completes.
* @cat Effects/Animations
*/ */
fadeIn: function(speed,callback){ fadeIn: function(speed,callback){
return this.animate({opacity: "show"}, speed, callback); return this.animate({opacity: "show"}, speed, callback);
@ -178,6 +188,7 @@ jQuery.fn.extend({
* @name fadeOut * @name fadeOut
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @cat Effects/Animations
*/ */
/** /**
@ -195,6 +206,7 @@ jQuery.fn.extend({
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @param Function callback A function to be executed whenever the animation completes. * @param Function callback A function to be executed whenever the animation completes.
* @cat Effects/Animations
*/ */
fadeOut: function(speed,callback){ fadeOut: function(speed,callback){
return this.animate({opacity: "hide"}, speed, callback); return this.animate({opacity: "hide"}, speed, callback);
@ -212,6 +224,7 @@ jQuery.fn.extend({
* @type jQuery * @type jQuery
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @param Number opacity The opacity to fade to (a number from 0 to 1). * @param Number opacity The opacity to fade to (a number from 0 to 1).
* @cat Effects/Animations
*/ */
/** /**
@ -230,6 +243,7 @@ jQuery.fn.extend({
* @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). * @param Object speed A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
* @param Number opacity The opacity to fade to (a number from 0 to 1). * @param Number opacity The opacity to fade to (a number from 0 to 1).
* @param Function callback A function to be executed whenever the animation completes. * @param Function callback A function to be executed whenever the animation completes.
* @cat Effects/Animations
*/ */
fadeTo: function(speed,to,callback){ fadeTo: function(speed,to,callback){
return this.animate({opacity: to}, speed, callback); return this.animate({opacity: to}, speed, callback);

146
jquery/jquery.js vendored
View file

@ -91,6 +91,7 @@ jQuery.fn = jQuery.prototype = {
* @property * @property
* @name jquery * @name jquery
* @type String * @type String
* @cat Core
*/ */
jquery: "$Rev$", jquery: "$Rev$",
@ -104,6 +105,7 @@ jQuery.fn = jQuery.prototype = {
* @property * @property
* @name length * @name length
* @type Number * @type Number
* @cat Core
*/ */
/** /**
@ -115,6 +117,7 @@ jQuery.fn = jQuery.prototype = {
* *
* @name size * @name size
* @type Number * @type Number
* @cat Core
*/ */
size: function() { size: function() {
return this.length; return this.length;
@ -131,11 +134,12 @@ jQuery.fn = jQuery.prototype = {
* *
* @name get * @name get
* @type Array<Element> * @type Array<Element>
* @cat Core
*/ */
/** /**
* Access a single matched element. <tt>num</tt> is used to access the * Access a single matched element. num is used to access the
* <tt>num</tt>th element matched. * Nth element matched.
* *
* @example $("img").get(1); * @example $("img").get(1);
* @before <img src="test1.jpg"/> <img src="test2.jpg"/> * @before <img src="test1.jpg"/> <img src="test2.jpg"/>
@ -143,7 +147,8 @@ jQuery.fn = jQuery.prototype = {
* *
* @name get * @name get
* @type Element * @type Element
* @param Number num Access the element in the <tt>num</tt>th position. * @param Number num Access the element in the Nth position.
* @cat Core
*/ */
/** /**
@ -156,6 +161,7 @@ jQuery.fn = jQuery.prototype = {
* @name get * @name get
* @type jQuery * @type jQuery
* @param Elements elems An array of elements * @param Elements elems An array of elements
* @cat Core
*/ */
get: function( num ) { get: function( num ) {
// Watch for when an array (of elements) is passed in // Watch for when an array (of elements) is passed in
@ -194,6 +200,7 @@ jQuery.fn = jQuery.prototype = {
* @name each * @name each
* @type jQuery * @type jQuery
* @param Function fn A function to execute * @param Function fn A function to execute
* @cat Core
*/ */
each: function( fn, args ) { each: function( fn, args ) {
return jQuery.each( this, fn, args ); return jQuery.each( this, fn, args );
@ -211,6 +218,7 @@ jQuery.fn = jQuery.prototype = {
* @name attr * @name attr
* @type Object * @type Object
* @param String name The name of the property to access. * @param String name The name of the property to access.
* @cat DOM
*/ */
/** /**
@ -225,6 +233,7 @@ jQuery.fn = jQuery.prototype = {
* @name attr * @name attr
* @type jQuery * @type jQuery
* @param Hash prop A set of key/value pairs to set as object properties. * @param Hash prop A set of key/value pairs to set as object properties.
* @cat DOM
*/ */
/** /**
@ -238,6 +247,7 @@ jQuery.fn = jQuery.prototype = {
* @type jQuery * @type jQuery
* @param String key The name of the property to set. * @param String key The name of the property to set.
* @param Object value The value to set the property to. * @param Object value The value to set the property to.
* @cat DOM
*/ */
attr: function( key, value, type ) { attr: function( key, value, type ) {
// Check to see if we're setting style values // Check to see if we're setting style values
@ -276,6 +286,7 @@ jQuery.fn = jQuery.prototype = {
* @name css * @name css
* @type Object * @type Object
* @param String name The name of the property to access. * @param String name The name of the property to access.
* @cat CSS
*/ */
/** /**
@ -290,6 +301,7 @@ jQuery.fn = jQuery.prototype = {
* @name css * @name css
* @type jQuery * @type jQuery
* @param Hash prop A set of key/value pairs to set as style properties. * @param Hash prop A set of key/value pairs to set as style properties.
* @cat CSS
*/ */
/** /**
@ -303,6 +315,7 @@ jQuery.fn = jQuery.prototype = {
* @type jQuery * @type jQuery
* @param String key The name of the property to set. * @param String key The name of the property to set.
* @param Object value The value to set the property to. * @param Object value The value to set the property to.
* @cat CSS
*/ */
css: function( key, value ) { css: function( key, value ) {
return this.attr( key, value, "curCSS" ); return this.attr( key, value, "curCSS" );
@ -319,6 +332,7 @@ jQuery.fn = jQuery.prototype = {
* *
* @name text * @name text
* @type String * @type String
* @cat DOM
*/ */
text: function(e) { text: function(e) {
e = e || this; e = e || this;
@ -352,6 +366,7 @@ jQuery.fn = jQuery.prototype = {
* @any Element elem A DOM element that will be wrapped. * @any Element elem A DOM element that will be wrapped.
* @any Array<Element> elems An array of elements, the first of which will be wrapped. * @any Array<Element> elems An array of elements, the first of which will be wrapped.
* @any Object obj Any object, converted to a string, then a text node. * @any Object obj Any object, converted to a string, then a text node.
* @cat DOM/Manipulation
*/ */
wrap: function() { wrap: function() {
// The elements to wrap the target around // The elements to wrap the target around
@ -376,7 +391,7 @@ jQuery.fn = jQuery.prototype = {
/** /**
* Append any number of elements to the inside of all matched elements. * Append any number of elements to the inside of all matched elements.
* This operation is similar to doing an <tt>appendChild</tt> to all the * This operation is similar to doing an appendChild to all the
* specified elements, adding them into the document. * specified elements, adding them into the document.
* *
* @example $("p").append("<b>Hello</b>"); * @example $("p").append("<b>Hello</b>");
@ -389,6 +404,7 @@ jQuery.fn = jQuery.prototype = {
* @any Element elem A DOM element that will be appended. * @any Element elem A DOM element that will be appended.
* @any Array<Element> elems An array of elements, all of which will be appended. * @any Array<Element> elems An array of elements, all of which will be appended.
* @any Object obj Any object, converted to a string, then a text node. * @any Object obj Any object, converted to a string, then a text node.
* @cat DOM/Manipulation
*/ */
append: function() { append: function() {
return this.domManip(arguments, true, 1, function(a){ return this.domManip(arguments, true, 1, function(a){
@ -411,6 +427,7 @@ jQuery.fn = jQuery.prototype = {
* @any Element elem A DOM element that will be prepended. * @any Element elem A DOM element that will be prepended.
* @any Array<Element> elems An array of elements, all of which will be prepended. * @any Array<Element> elems An array of elements, all of which will be prepended.
* @any Object obj Any object, converted to a string, then a text node. * @any Object obj Any object, converted to a string, then a text node.
* @cat DOM/Manipulation
*/ */
prepend: function() { prepend: function() {
return this.domManip(arguments, true, -1, function(a){ return this.domManip(arguments, true, -1, function(a){
@ -431,6 +448,7 @@ jQuery.fn = jQuery.prototype = {
* @any Element elem A DOM element that will beinserted. * @any Element elem A DOM element that will beinserted.
* @any Array<Element> elems An array of elements, all of which will be inserted. * @any Array<Element> elems An array of elements, all of which will be inserted.
* @any Object obj Any object, converted to a string, then a text node. * @any Object obj Any object, converted to a string, then a text node.
* @cat DOM/Manipulation
*/ */
before: function() { before: function() {
return this.domManip(arguments, false, 1, function(a){ return this.domManip(arguments, false, 1, function(a){
@ -451,6 +469,7 @@ jQuery.fn = jQuery.prototype = {
* @any Element elem A DOM element that will beinserted. * @any Element elem A DOM element that will beinserted.
* @any Array<Element> elems An array of elements, all of which will be inserted. * @any Array<Element> elems An array of elements, all of which will be inserted.
* @any Object obj Any object, converted to a string, then a text node. * @any Object obj Any object, converted to a string, then a text node.
* @cat DOM/Manipulation
*/ */
after: function() { after: function() {
return this.domManip(arguments, false, -1, function(a){ return this.domManip(arguments, false, -1, function(a){
@ -469,6 +488,7 @@ jQuery.fn = jQuery.prototype = {
* *
* @name end * @name end
* @type jQuery * @type jQuery
* @cat DOM/Traversing
*/ */
end: function() { end: function() {
return this.get( this.stack.pop() ); return this.get( this.stack.pop() );
@ -489,6 +509,7 @@ jQuery.fn = jQuery.prototype = {
* @name find * @name find
* @type jQuery * @type jQuery
* @param String expr An expression to search with. * @param String expr An expression to search with.
* @cat DOM/Traversing
*/ */
find: function(t) { find: function(t) {
return this.pushStack( jQuery.map( this, function(a){ return this.pushStack( jQuery.map( this, function(a){
@ -511,6 +532,7 @@ jQuery.fn = jQuery.prototype = {
* @name filter * @name filter
* @type jQuery * @type jQuery
* @param String expr An expression to search with. * @param String expr An expression to search with.
* @cat DOM/Traversing
*/ */
/** /**
@ -529,6 +551,7 @@ jQuery.fn = jQuery.prototype = {
* @name filter * @name filter
* @type jQuery * @type jQuery
* @param Array<String> exprs A set of expressions to evaluate against * @param Array<String> exprs A set of expressions to evaluate against
* @cat DOM/Traversing
*/ */
filter: function(t) { filter: function(t) {
return this.pushStack( return this.pushStack(
@ -559,6 +582,7 @@ jQuery.fn = jQuery.prototype = {
* @name not * @name not
* @type jQuery * @type jQuery
* @param Element el An element to remove from the set * @param Element el An element to remove from the set
* @cat DOM/Traversing
*/ */
/** /**
@ -573,6 +597,7 @@ jQuery.fn = jQuery.prototype = {
* @name not * @name not
* @type jQuery * @type jQuery
* @param String expr An expression with which to remove matching elements * @param String expr An expression with which to remove matching elements
* @cat DOM/Traversing
*/ */
not: function(t) { not: function(t) {
return this.pushStack( t.constructor == String ? return this.pushStack( t.constructor == String ?
@ -591,6 +616,7 @@ jQuery.fn = jQuery.prototype = {
* @name add * @name add
* @type jQuery * @type jQuery
* @param String expr An expression whose matched elements are added * @param String expr An expression whose matched elements are added
* @cat DOM/Traversing
*/ */
/** /**
@ -604,6 +630,7 @@ jQuery.fn = jQuery.prototype = {
* @name add * @name add
* @type jQuery * @type jQuery
* @param Array<Element> els An array of Elements to add * @param Array<Element> els An array of Elements to add
* @cat jQuery
*/ */
/** /**
@ -617,6 +644,7 @@ jQuery.fn = jQuery.prototype = {
* @name add * @name add
* @type jQuery * @type jQuery
* @param Element el An Element to add * @param Element el An Element to add
* @cat jQuery
*/ */
add: function(t) { add: function(t) {
return this.pushStack( jQuery.merge( this, t.constructor == String ? return this.pushStack( jQuery.merge( this, t.constructor == String ?
@ -631,6 +659,7 @@ jQuery.fn = jQuery.prototype = {
* @member jQuery * @member jQuery
* @param {String} expr The expression with which to filter * @param {String} expr The expression with which to filter
* @type Boolean * @type Boolean
* @cat jQuery
*/ */
is: function(expr) { is: function(expr) {
return expr ? jQuery.filter(expr,this).r.length > 0 : this.length > 0; return expr ? jQuery.filter(expr,this).r.length > 0 : this.length > 0;
@ -717,6 +746,7 @@ jQuery.fn = jQuery.prototype = {
* @param Object obj The object to extend * @param Object obj The object to extend
* @param Object prop The object that will be merged into the first. * @param Object prop The object that will be merged into the first.
* @type Object * @type Object
* @cat Javascript
*/ */
jQuery.extend = jQuery.fn.extend = function(obj,prop) { jQuery.extend = jQuery.fn.extend = function(obj,prop) {
if ( !prop ) { prop = obj; obj = this; } if ( !prop ) { prop = obj; obj = this; }
@ -793,6 +823,7 @@ jQuery.extend({
* @param Object obj The object, or array, to iterate over. * @param Object obj The object, or array, to iterate over.
* @param Object fn The function that will be executed on every object. * @param Object fn The function that will be executed on every object.
* @type Object * @type Object
* @cat Javascript
*/ */
each: function( obj, fn, args ) { each: function( obj, fn, args ) {
if ( obj.length == undefined ) if ( obj.length == undefined )
@ -1476,6 +1507,7 @@ jQuery.macros = {
* @name appendTo * @name appendTo
* @type jQuery * @type jQuery
* @param String expr A jQuery expression of elements to match. * @param String expr A jQuery expression of elements to match.
* @cat DOM/Manipulation
*/ */
appendTo: "append", appendTo: "append",
@ -1492,6 +1524,7 @@ jQuery.macros = {
* @name prependTo * @name prependTo
* @type jQuery * @type jQuery
* @param String expr A jQuery expression of elements to match. * @param String expr A jQuery expression of elements to match.
* @cat DOM/Manipulation
*/ */
prependTo: "prepend", prependTo: "prepend",
@ -1508,6 +1541,7 @@ jQuery.macros = {
* @name insertBefore * @name insertBefore
* @type jQuery * @type jQuery
* @param String expr A jQuery expression of elements to match. * @param String expr A jQuery expression of elements to match.
* @cat DOM/Manipulation
*/ */
insertBefore: "before", insertBefore: "before",
@ -1524,6 +1558,7 @@ jQuery.macros = {
* @name insertAfter * @name insertAfter
* @type jQuery * @type jQuery
* @param String expr A jQuery expression of elements to match. * @param String expr A jQuery expression of elements to match.
* @cat DOM/Manipulation
*/ */
insertAfter: "after" insertAfter: "after"
}, },
@ -1537,6 +1572,7 @@ jQuery.macros = {
* *
* @name width * @name width
* @type String * @type String
* @cat CSS
*/ */
/** /**
@ -1551,6 +1587,7 @@ jQuery.macros = {
* @name width * @name width
* @type jQuery * @type jQuery
* @param String val Set the CSS property to the specified value. * @param String val Set the CSS property to the specified value.
* @cat CSS
*/ */
/** /**
@ -1562,6 +1599,7 @@ jQuery.macros = {
* *
* @name height * @name height
* @type String * @type String
* @cat CSS
*/ */
/** /**
@ -1576,6 +1614,7 @@ jQuery.macros = {
* @name height * @name height
* @type jQuery * @type jQuery
* @param String val Set the CSS property to the specified value. * @param String val Set the CSS property to the specified value.
* @cat CSS
*/ */
/** /**
@ -1587,6 +1626,7 @@ jQuery.macros = {
* *
* @name top * @name top
* @type String * @type String
* @cat CSS
*/ */
/** /**
@ -1601,6 +1641,7 @@ jQuery.macros = {
* @name top * @name top
* @type jQuery * @type jQuery
* @param String val Set the CSS property to the specified value. * @param String val Set the CSS property to the specified value.
* @cat CSS
*/ */
/** /**
@ -1612,6 +1653,7 @@ jQuery.macros = {
* *
* @name left * @name left
* @type String * @type String
* @cat CSS
*/ */
/** /**
@ -1626,6 +1668,7 @@ jQuery.macros = {
* @name left * @name left
* @type jQuery * @type jQuery
* @param String val Set the CSS property to the specified value. * @param String val Set the CSS property to the specified value.
* @cat CSS
*/ */
/** /**
@ -1637,6 +1680,7 @@ jQuery.macros = {
* *
* @name position * @name position
* @type String * @type String
* @cat CSS
*/ */
/** /**
@ -1649,6 +1693,7 @@ jQuery.macros = {
* @name position * @name position
* @type jQuery * @type jQuery
* @param String val Set the CSS property to the specified value. * @param String val Set the CSS property to the specified value.
* @cat CSS
*/ */
/** /**
@ -1660,6 +1705,7 @@ jQuery.macros = {
* *
* @name float * @name float
* @type String * @type String
* @cat CSS
*/ */
/** /**
@ -1672,6 +1718,7 @@ jQuery.macros = {
* @name float * @name float
* @type jQuery * @type jQuery
* @param String val Set the CSS property to the specified value. * @param String val Set the CSS property to the specified value.
* @cat CSS
*/ */
/** /**
@ -1683,6 +1730,7 @@ jQuery.macros = {
* *
* @name overflow * @name overflow
* @type String * @type String
* @cat CSS
*/ */
/** /**
@ -1695,6 +1743,7 @@ jQuery.macros = {
* @name overflow * @name overflow
* @type jQuery * @type jQuery
* @param String val Set the CSS property to the specified value. * @param String val Set the CSS property to the specified value.
* @cat CSS
*/ */
/** /**
@ -1706,6 +1755,7 @@ jQuery.macros = {
* *
* @name color * @name color
* @type String * @type String
* @cat CSS
*/ */
/** /**
@ -1718,6 +1768,7 @@ jQuery.macros = {
* @name color * @name color
* @type jQuery * @type jQuery
* @param String val Set the CSS property to the specified value. * @param String val Set the CSS property to the specified value.
* @cat CSS
*/ */
/** /**
@ -1729,6 +1780,7 @@ jQuery.macros = {
* *
* @name background * @name background
* @type String * @type String
* @cat CSS
*/ */
/** /**
@ -1741,6 +1793,7 @@ jQuery.macros = {
* @name background * @name background
* @type jQuery * @type jQuery
* @param String val Set the CSS property to the specified value. * @param String val Set the CSS property to the specified value.
* @cat CSS
*/ */
css: "width,height,top,left,position,float,overflow,color,background".split(","), css: "width,height,top,left,position,float,overflow,color,background".split(","),
@ -1757,6 +1810,7 @@ jQuery.macros = {
* *
* @name val * @name val
* @type String * @type String
* @cat DOM/Attributes
*/ */
/** /**
@ -1769,6 +1823,7 @@ jQuery.macros = {
* @name val * @name val
* @type jQuery * @type jQuery
* @param String val Set the property to the specified value. * @param String val Set the property to the specified value.
* @cat DOM/Attributes
*/ */
val: "value", val: "value",
@ -1781,6 +1836,7 @@ jQuery.macros = {
* *
* @name html * @name html
* @type String * @type String
* @cat DOM/Attributes
*/ */
/** /**
@ -1788,11 +1844,12 @@ jQuery.macros = {
* *
* @example $("div").html("<b>new stuff</b>"); * @example $("div").html("<b>new stuff</b>");
* @before <div><input/></div> * @before <div><input/></div>
* @result <div><b>new stuff</b</div> * @result <div><b>new stuff</b></div>
* *
* @name html * @name html
* @type jQuery * @type jQuery
* @param String val Set the html contents to the specified value. * @param String val Set the html contents to the specified value.
* @cat DOM/Attributes
*/ */
html: "innerHTML", html: "innerHTML",
@ -1805,6 +1862,7 @@ jQuery.macros = {
* *
* @name id * @name id
* @type String * @type String
* @cat DOM/Attributes
*/ */
/** /**
@ -1817,6 +1875,7 @@ jQuery.macros = {
* @name id * @name id
* @type jQuery * @type jQuery
* @param String val Set the property to the specified value. * @param String val Set the property to the specified value.
* @cat DOM/Attributes
*/ */
id: null, id: null,
@ -1829,6 +1888,7 @@ jQuery.macros = {
* *
* @name title * @name title
* @type String * @type String
* @cat DOM/Attributes
*/ */
/** /**
@ -1841,6 +1901,7 @@ jQuery.macros = {
* @name title * @name title
* @type jQuery * @type jQuery
* @param String val Set the property to the specified value. * @param String val Set the property to the specified value.
* @cat DOM/Attributes
*/ */
title: null, title: null,
@ -1853,6 +1914,7 @@ jQuery.macros = {
* *
* @name name * @name name
* @type String * @type String
* @cat DOM/Attributes
*/ */
/** /**
@ -1865,6 +1927,7 @@ jQuery.macros = {
* @name name * @name name
* @type jQuery * @type jQuery
* @param String val Set the property to the specified value. * @param String val Set the property to the specified value.
* @cat DOM/Attributes
*/ */
name: null, name: null,
@ -1877,6 +1940,7 @@ jQuery.macros = {
* *
* @name href * @name href
* @type String * @type String
* @cat DOM/Attributes
*/ */
/** /**
@ -1889,6 +1953,7 @@ jQuery.macros = {
* @name href * @name href
* @type jQuery * @type jQuery
* @param String val Set the property to the specified value. * @param String val Set the property to the specified value.
* @cat DOM/Attributes
*/ */
href: null, href: null,
@ -1901,6 +1966,7 @@ jQuery.macros = {
* *
* @name src * @name src
* @type String * @type String
* @cat DOM/Attributes
*/ */
/** /**
@ -1913,6 +1979,7 @@ jQuery.macros = {
* @name src * @name src
* @type jQuery * @type jQuery
* @param String val Set the property to the specified value. * @param String val Set the property to the specified value.
* @cat DOM/Attributes
*/ */
src: null, src: null,
@ -1925,6 +1992,7 @@ jQuery.macros = {
* *
* @name rel * @name rel
* @type String * @type String
* @cat DOM/Attributes
*/ */
/** /**
@ -1937,6 +2005,7 @@ jQuery.macros = {
* @name rel * @name rel
* @type jQuery * @type jQuery
* @param String val Set the property to the specified value. * @param String val Set the property to the specified value.
* @cat DOM/Attributes
*/ */
rel: null rel: null
}, },
@ -1952,6 +2021,7 @@ jQuery.macros = {
* *
* @name parent * @name parent
* @type jQuery * @type jQuery
* @cat DOM/Traversing
*/ */
/** /**
@ -1965,6 +2035,7 @@ jQuery.macros = {
* @name parent * @name parent
* @type jQuery * @type jQuery
* @param String expr An expression to filter the parents with * @param String expr An expression to filter the parents with
* @cat DOM/Traversing
*/ */
parent: "a.parentNode", parent: "a.parentNode",
@ -1978,6 +2049,7 @@ jQuery.macros = {
* *
* @name ancestors * @name ancestors
* @type jQuery * @type jQuery
* @cat DOM/Traversing
*/ */
/** /**
@ -1991,6 +2063,7 @@ jQuery.macros = {
* @name ancestors * @name ancestors
* @type jQuery * @type jQuery
* @param String expr An expression to filter the ancestors with * @param String expr An expression to filter the ancestors with
* @cat DOM/Traversing
*/ */
ancestors: jQuery.parents, ancestors: jQuery.parents,
@ -2004,6 +2077,7 @@ jQuery.macros = {
* *
* @name parents * @name parents
* @type jQuery * @type jQuery
* @cat DOM/Traversing
*/ */
/** /**
@ -2017,6 +2091,7 @@ jQuery.macros = {
* @name parents * @name parents
* @type jQuery * @type jQuery
* @param String expr An expression to filter the ancestors with * @param String expr An expression to filter the ancestors with
* @cat DOM/Traversing
*/ */
parents: jQuery.parents, parents: jQuery.parents,
@ -2032,6 +2107,7 @@ jQuery.macros = {
* *
* @name next * @name next
* @type jQuery * @type jQuery
* @cat DOM/Traversing
*/ */
/** /**
@ -2047,6 +2123,7 @@ jQuery.macros = {
* @name next * @name next
* @type jQuery * @type jQuery
* @param String expr An expression to filter the next Elements with * @param String expr An expression to filter the next Elements with
* @cat DOM/Traversing
*/ */
next: "jQuery.sibling(a).next", next: "jQuery.sibling(a).next",
@ -2062,6 +2139,7 @@ jQuery.macros = {
* *
* @name prev * @name prev
* @type jQuery * @type jQuery
* @cat DOM/Traversing
*/ */
/** /**
@ -2077,6 +2155,7 @@ jQuery.macros = {
* @name prev * @name prev
* @type jQuery * @type jQuery
* @param String expr An expression to filter the previous Elements with * @param String expr An expression to filter the previous Elements with
* @cat DOM/Traversing
*/ */
prev: "jQuery.sibling(a).prev", prev: "jQuery.sibling(a).prev",
@ -2090,6 +2169,7 @@ jQuery.macros = {
* *
* @name siblings * @name siblings
* @type jQuery * @type jQuery
* @cat DOM/Traversing
*/ */
/** /**
@ -2103,6 +2183,7 @@ jQuery.macros = {
* @name siblings * @name siblings
* @type jQuery * @type jQuery
* @param String expr An expression to filter the sibling Elements with * @param String expr An expression to filter the sibling Elements with
* @cat DOM/Traversing
*/ */
siblings: jQuery.sibling, siblings: jQuery.sibling,
@ -2117,10 +2198,11 @@ jQuery.macros = {
* *
* @name children * @name children
* @type jQuery * @type jQuery
* @cat DOM/Traversing
*/ */
/** /**
* Get a set of elements containing all of the unique siblings of each of the * Get a set of elements containing all of the unique children of each of the
* matched set of elements, and filtered by an expression. * matched set of elements, and filtered by an expression.
* *
* @example $("div").children(".selected") * @example $("div").children(".selected")
@ -2130,6 +2212,7 @@ jQuery.macros = {
* @name children * @name children
* @type jQuery * @type jQuery
* @param String expr An expression to filter the child Elements with * @param String expr An expression to filter the child Elements with
* @cat DOM/Traversing
*/ */
children: "a.childNodes" children: "a.childNodes"
}, },
@ -2144,6 +2227,7 @@ jQuery.macros = {
* *
* @name show * @name show
* @type jQuery * @type jQuery
* @cat Effects
*/ */
_show: function(){ _show: function(){
this.style.display = this.oldblock ? this.oldblock : ""; this.style.display = this.oldblock ? this.oldblock : "";
@ -2160,6 +2244,7 @@ jQuery.macros = {
* *
* @name hide * @name hide
* @type jQuery * @type jQuery
* @cat Effects
*/ */
_hide: function(){ _hide: function(){
this.oldblock = this.oldblock || jQuery.css(this,"display"); this.oldblock = this.oldblock || jQuery.css(this,"display");
@ -2179,6 +2264,7 @@ jQuery.macros = {
* *
* @name toggle * @name toggle
* @type jQuery * @type jQuery
* @cat Effects
*/ */
_toggle: function(){ _toggle: function(){
var d = jQuery.css(this,"display"); var d = jQuery.css(this,"display");
@ -2188,52 +2274,78 @@ jQuery.macros = {
/** /**
* Adds the specified class to each of the set of matched elements. * Adds the specified class to each of the set of matched elements.
* *
* @example ("p").addClass("selected") * @example $("p").addClass("selected")
* @before <p>Hello</p> * @before <p>Hello</p>
* @result [ <p class="selected">Hello</p> ] * @result [ <p class="selected">Hello</p> ]
* *
* @name addClass * @name addClass
* @type jQuery * @type jQuery
* @param String class A CSS class to add to the elements * @param String class A CSS class to add to the elements
* @cat DOM
*/ */
addClass: function(c){ addClass: function(c){
jQuery.className.add(this,c); jQuery.className.add(this,c);
}, },
/** /**
* The opposite of addClass. Removes the specified class from the * Removes the specified class from the set of matched elements.
* set of matched elements.
* *
* @example ("p").removeClass("selected") * @example $("p").removeClass("selected")
* @before <p class="selected">Hello</p> * @before <p class="selected">Hello</p>
* @result [ <p>Hello</p> ] * @result [ <p>Hello</p> ]
* *
* @name removeClass * @name removeClass
* @type jQuery * @type jQuery
* @param String class A CSS class to remove from the elements * @param String class A CSS class to remove from the elements
* @cat DOM
*/ */
removeClass: function(c){ removeClass: function(c){
jQuery.className.remove(this,c); jQuery.className.remove(this,c);
}, },
/** /**
* Adds the specified class if it is present. Remove it if it is * Adds the specified class if it is present, removes it if it is
* not present. * not present.
* *
* @example ("p").toggleClass("selected") * @example $("p").toggleClass("selected")
* @before <p>Hello</p><p class="selected">Hello Again</p> * @before <p>Hello</p><p class="selected">Hello Again</p>
* @result [ <p class="selected">Hello</p>, <p>Hello Again</p> ] * @result [ <p class="selected">Hello</p>, <p>Hello Again</p> ]
* *
* @name toggleClass * @name toggleClass
* @type jQuery * @type jQuery
* @param String class A CSS class with which to toggle the elements * @param String class A CSS class with which to toggle the elements
* @cat DOM
*/ */
toggleClass: function( c ){ toggleClass: function( c ){
jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this,c); jQuery.className[ jQuery.className.has(this,c) ? "remove" : "add" ](this,c);
}, },
/** /**
* TODO: Document * Removes all matched elements from the DOM. This does NOT remove them from the
* jQuery object, allowing you to use the matched elements further.
*
* @example $("p").remove();
* @before <p>Hello</p> how are <p>you?</p>
* @result how are
*
* @name remove
* @type jQuery
* @cat DOM/Manipulation
*/
/**
* Removes only elements (out of the list of matched elements) that match
* the specified jQuery expression. This does NOT remove them from the
* jQuery object, allowing you to use the matched elements further.
*
* @example $("p").remove(".hello");
* @before <p class="hello">Hello</p> how are <p>you?</p>
* @result how are <p>you?</p>
*
* @name remove
* @type jQuery
* @param String expr A jQuery expression to filter elements by.
* @cat DOM/Manipulation
*/ */
remove: function(a){ remove: function(a){
if ( !a || jQuery.filter( [this], a ).r ) if ( !a || jQuery.filter( [this], a ).r )
@ -2243,12 +2355,13 @@ jQuery.macros = {
/** /**
* Removes all child nodes from the set of matched elements. * Removes all child nodes from the set of matched elements.
* *
* @example ("p").empty() * @example $("p").empty()
* @before <p>Hello, <span>Person</span> <a href="#">and person</a></p> * @before <p>Hello, <span>Person</span> <a href="#">and person</a></p>
* @result [ <p></p> ] * @result [ <p></p> ]
* *
* @name empty * @name empty
* @type jQuery * @type jQuery
* @cat DOM/Manipulation
*/ */
empty: function(){ empty: function(){
while ( this.firstChild ) while ( this.firstChild )
@ -2279,6 +2392,7 @@ jQuery.macros = {
* @type jQuery * @type jQuery
* @param String type An event type * @param String type An event type
* @param Function fn A function to bind to the event on each of the set of matched elements * @param Function fn A function to bind to the event on each of the set of matched elements
* @cat Events
*/ */
bind: function( type, fn ) { bind: function( type, fn ) {
if ( fn.constructor == String ) if ( fn.constructor == String )
@ -2299,6 +2413,7 @@ jQuery.macros = {
* @type jQuery * @type jQuery
* @param String type An event type * @param String type An event type
* @param Function fn A function to unbind from the event on each of the set of matched elements * @param Function fn A function to unbind from the event on each of the set of matched elements
* @cat Events
*/ */
/** /**
@ -2312,6 +2427,7 @@ jQuery.macros = {
* @name unbind * @name unbind
* @type jQuery * @type jQuery
* @param String type An event type * @param String type An event type
* @cat Events
*/ */
/** /**
@ -2323,6 +2439,7 @@ jQuery.macros = {
* *
* @name unbind * @name unbind
* @type jQuery * @type jQuery
* @cat Events
*/ */
unbind: function( type, fn ) { unbind: function( type, fn ) {
jQuery.event.remove( this, type, fn ); jQuery.event.remove( this, type, fn );
@ -2338,6 +2455,7 @@ jQuery.macros = {
* @name trigger * @name trigger
* @type jQuery * @type jQuery
* @param String type An event type to trigger. * @param String type An event type to trigger.
* @cat Events
*/ */
trigger: function( type, data ) { trigger: function( type, data ) {
jQuery.event.trigger( type, data, this ); jQuery.event.trigger( type, data, this );