Merged the three unbind docs into one, added a few more (optional) hints; Use one...
[jquery.git] / src / fx / fx.js
index 308567c..dd72c65 100644 (file)
@@ -4,33 +4,24 @@ jQuery.fn.extend({
        _show: jQuery.fn.show,\r
        \r
        /**\r
-        * Show all matched elements using a graceful animation.\r
+        * Show all matched elements using a graceful animation and firing an\r
+        * optional callback after completion.\r
+        *\r
         * The height, width, and opacity of each of the matched elements \r
         * are changed dynamically according to the specified speed.\r
         *\r
         * @example $("p").show("slow");\r
         *\r
-        * @name show\r
-        * @type jQuery\r
-        * @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).\r
-        * @cat Effects/Animations\r
-        */\r
-        \r
-       /**\r
-        * Show all matched elements using a graceful animation and firing a callback\r
-        * function after completion.\r
-        * The height, width, and opacity of each of the matched elements \r
-        * are changed dynamically according to the specified speed.\r
-        *\r
         * @example $("p").show("slow",function(){\r
         *   alert("Animation Done.");\r
         * });\r
         *\r
         * @name show\r
         * @type jQuery\r
-        * @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).\r
-        * @param Function callback A function to be executed whenever the animation completes.\r
+        * @param String|Number 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).\r
+        * @param Function callback (optional) A function to be executed whenever the animation completes.\r
         * @cat Effects/Animations\r
+        * @see hide(String|Number,Function)\r
         */\r
        show: function(speed,callback){\r
                return speed ? this.animate({\r
@@ -42,33 +33,24 @@ jQuery.fn.extend({
        _hide: jQuery.fn.hide,\r
        \r
        /**\r
-        * Hide all matched elements using a graceful animation.\r
+        * Hide all matched elements using a graceful animation and firing an\r
+        * optional callback after completion.\r
+        *\r
         * The height, width, and opacity of each of the matched elements \r
         * are changed dynamically according to the specified speed.\r
         *\r
         * @example $("p").hide("slow");\r
         *\r
-        * @name hide\r
-        * @type jQuery\r
-        * @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).\r
-        * @cat Effects/Animations\r
-        */\r
-        \r
-       /**\r
-        * Hide all matched elements using a graceful animation and firing a callback\r
-        * function after completion.\r
-        * The height, width, and opacity of each of the matched elements \r
-        * are changed dynamically according to the specified speed.\r
-        *\r
         * @example $("p").hide("slow",function(){\r
         *   alert("Animation Done.");\r
         * });\r
         *\r
         * @name hide\r
         * @type jQuery\r
-        * @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).\r
-        * @param Function callback A function to be executed whenever the animation completes.\r
+        * @param String|Number 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).\r
+        * @param Function callback (optional) A function to be executed whenever the animation completes.\r
         * @cat Effects/Animations\r
+        * @see show(String|Number,Function)\r
         */\r
        hide: function(speed,callback){\r
                return speed ? this.animate({\r
@@ -77,101 +59,77 @@ jQuery.fn.extend({
        },\r
        \r
        /**\r
-        * Reveal all matched elements by adjusting their height.\r
+        * Reveal all matched elements by adjusting their height and firing an\r
+        * optional callback after completion.\r
+        *\r
         * Only the height is adjusted for this animation, causing all matched\r
         * elements to be revealed in a "sliding" manner.\r
         *\r
         * @example $("p").slideDown("slow");\r
         *\r
-        * @name slideDown\r
-        * @type jQuery\r
-        * @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).\r
-        * @cat Effects/Animations\r
-        */\r
-        \r
-       /**\r
-        * Reveal all matched elements by adjusting their height and firing a callback\r
-        * function after completion.\r
-        * Only the height is adjusted for this animation, causing all matched\r
-        * elements to be revealed in a "sliding" manner.\r
-        *\r
         * @example $("p").slideDown("slow",function(){\r
         *   alert("Animation Done.");\r
         * });\r
         *\r
         * @name slideDown\r
         * @type jQuery\r
-        * @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).\r
-        * @param Function callback A function to be executed whenever the animation completes.\r
+        * @param String|Number speed (optional) 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).\r
+        * @param Function callback (optional) A function to be executed whenever the animation completes.\r
         * @cat Effects/Animations\r
+        * @see slideUp(String|Number,Function)\r
+        * @see slideToggle(String|Number,Function)\r
         */\r
        slideDown: function(speed,callback){\r
                return this.animate({height: "show"}, speed, callback);\r
        },\r
        \r
        /**\r
-        * Hide all matched elements by adjusting their height.\r
+        * Hide all matched elements by adjusting their height and firing an\r
+        * optional callback after completion.\r
+        *\r
         * Only the height is adjusted for this animation, causing all matched\r
         * elements to be hidden in a "sliding" manner.\r
         *\r
         * @example $("p").slideUp("slow");\r
         *\r
-        * @name slideUp\r
-        * @type jQuery\r
-        * @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).\r
-        * @cat Effects/Animations\r
-        */\r
-        \r
-       /**\r
-        * Hide all matched elements by adjusting their height and firing a callback\r
-        * function after completion.\r
-        * Only the height is adjusted for this animation, causing all matched\r
-        * elements to be hidden in a "sliding" manner.\r
-        *\r
         * @example $("p").slideUp("slow",function(){\r
         *   alert("Animation Done.");\r
         * });\r
         *\r
         * @name slideUp\r
         * @type jQuery\r
-        * @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).\r
-        * @param Function callback A function to be executed whenever the animation completes.\r
+        * @param String|Number speed (optional) 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).\r
+        * @param Function callback (optional) A function to be executed whenever the animation completes.\r
         * @cat Effects/Animations\r
+        * @see slideDown(String|Number,Function)\r
+        * @see slideToggle(String|Number,Function)\r
         */\r
        slideUp: function(speed,callback){\r
                return this.animate({height: "hide"}, speed, callback);\r
        },\r
 \r
        /**\r
-        * Toggle the visibility of all matched elements by adjusting their height.\r
+        * Toggle the visibility of all matched elements by adjusting their height and firing an\r
+        * optional callback after completion.\r
+        *\r
         * Only the height is adjusted for this animation, causing all matched\r
         * elements to be hidden in a "sliding" manner.\r
         *\r
         * @example $("p").slideToggle("slow");\r
         *\r
-        * @name slideToggle\r
-        * @type jQuery\r
-        * @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).\r
-        * @cat Effects/Animations\r
-        */\r
-        \r
-       /**\r
-        * Toggle the visibility of all matched elements by adjusting their height\r
-        * and firing a callback function after completion.\r
-        * Only the height is adjusted for this animation, causing all matched\r
-        * elements to be hidden in a "sliding" manner.\r
-        *\r
         * @example $("p").slideToggle("slow",function(){\r
         *   alert("Animation Done.");\r
         * });\r
         *\r
         * @name slideToggle\r
         * @type jQuery\r
-        * @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).\r
-        * @param Function callback A function to be executed whenever the animation completes.\r
+        * @param String|Number speed (optional) 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).\r
+        * @param Function callback (optional) A function to be executed whenever the animation completes.\r
         * @cat Effects/Animations\r
+        * @see slideDown(String|Number,Function)\r
+        * @see slideUp(String|Number,Function)\r
         */\r
-       slideToggle: function(speed,callback){\r
+       slideToggle: function(speed, callback){\r
                return this.each(function(){\r
                        var state = jQuery(this).is(":hidden") ? "show" : "hide";\r
                        jQuery(this).animate({height: state}, speed, callback);\r
@@ -179,107 +137,79 @@ jQuery.fn.extend({
        },\r
        \r
        /**\r
-        * Fade in all matched elements by adjusting their opacity.\r
+        * Fade in all matched elements by adjusting their opacity and firing an\r
+        * optional callback after completion.\r
+        *\r
         * Only the opacity is adjusted for this animation, meaning that\r
         * all of the matched elements should already have some form of height\r
         * and width associated with them.\r
         *\r
         * @example $("p").fadeIn("slow");\r
         *\r
-        * @name fadeIn\r
-        * @type jQuery\r
-        * @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).\r
-        * @cat Effects/Animations\r
-        */\r
-        \r
-       /**\r
-        * Fade in all matched elements by adjusting their opacity and firing a \r
-        * callback function after completion.\r
-        * Only the opacity is adjusted for this animation, meaning that\r
-        * all of the matched elements should already have some form of height\r
-        * and width associated with them.\r
-        *\r
         * @example $("p").fadeIn("slow",function(){\r
         *   alert("Animation Done.");\r
         * });\r
         *\r
         * @name fadeIn\r
         * @type jQuery\r
-        * @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).\r
-        * @param Function callback A function to be executed whenever the animation completes.\r
+        * @param String|Number speed (optional) 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).\r
+        * @param Function callback (optional) A function to be executed whenever the animation completes.\r
         * @cat Effects/Animations\r
+        * @see fadeOut(String|Number,Function)\r
+        * @see fadeTo(String|Number,Number,Function)\r
         */\r
-       fadeIn: function(speed,callback){\r
+       fadeIn: function(speed, callback){\r
                return this.animate({opacity: "show"}, speed, callback);\r
        },\r
        \r
        /**\r
-        * Fade out all matched elements by adjusting their opacity.\r
+        * Fade out all matched elements by adjusting their opacity and firing an\r
+        * optional callback after completion.\r
+        *\r
         * Only the opacity is adjusted for this animation, meaning that\r
         * all of the matched elements should already have some form of height\r
         * and width associated with them.\r
         *\r
         * @example $("p").fadeOut("slow");\r
         *\r
-        * @name fadeOut\r
-        * @type jQuery\r
-        * @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).\r
-        * @cat Effects/Animations\r
-        */\r
-        \r
-       /**\r
-        * Fade out all matched elements by adjusting their opacity and firing a \r
-        * callback function after completion.\r
-        * Only the opacity is adjusted for this animation, meaning that\r
-        * all of the matched elements should already have some form of height\r
-        * and width associated with them.\r
-        *\r
         * @example $("p").fadeOut("slow",function(){\r
         *   alert("Animation Done.");\r
         * });\r
         *\r
         * @name fadeOut\r
         * @type jQuery\r
-        * @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).\r
-        * @param Function callback A function to be executed whenever the animation completes.\r
+        * @param String|Number speed (optional) 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).\r
+        * @param Function callback (optional) A function to be executed whenever the animation completes.\r
         * @cat Effects/Animations\r
+        * @see fadeIn(String|Number,Function)\r
+        * @see fadeTo(String|Number,Number,Function)\r
         */\r
-       fadeOut: function(speed,callback){\r
+       fadeOut: function(speed, callback){\r
                return this.animate({opacity: "hide"}, speed, callback);\r
        },\r
        \r
        /**\r
-        * Fade the opacity of all matched elements to a specified opacity.\r
+        * Fade the opacity of all matched elements to a specified opacity and firing an\r
+        * optional callback after completion.\r
+        *\r
         * Only the opacity is adjusted for this animation, meaning that\r
         * all of the matched elements should already have some form of height\r
         * and width associated with them.\r
         *\r
         * @example $("p").fadeTo("slow", 0.5);\r
         *\r
-        * @name fadeTo\r
-        * @type jQuery\r
-        * @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).\r
-        * @param Number opacity The opacity to fade to (a number from 0 to 1).\r
-        * @cat Effects/Animations\r
-        */\r
-        \r
-       /**\r
-        * Fade the opacity of all matched elements to a specified opacity and \r
-        * firing a callback function after completion.\r
-        * Only the opacity is adjusted for this animation, meaning that\r
-        * all of the matched elements should already have some form of height\r
-        * and width associated with them.\r
-        *\r
         * @example $("p").fadeTo("slow", 0.5, function(){\r
         *   alert("Animation Done.");\r
         * });\r
         *\r
         * @name fadeTo\r
         * @type jQuery\r
-        * @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).\r
+        * @param String|Number 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).\r
         * @param Number opacity The opacity to fade to (a number from 0 to 1).\r
-        * @param Function callback A function to be executed whenever the animation completes.\r
+        * @param Function callback (optional) A function to be executed whenever the animation completes.\r
         * @cat Effects/Animations\r
+        * @see fadeIn(String|Number,Function)\r
+        * @see fadeOut(String|Number,Function)\r
         */\r
        fadeTo: function(speed,to,callback){\r
                return this.animate({opacity: to}, speed, callback);\r
@@ -308,8 +238,8 @@ jQuery.fn.extend({
         * @name animate\r
         * @type jQuery\r
         * @param Hash params A set of style attributes that you wish to animate, and to what end.\r
-        * @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).\r
-        * @param Function callback A function to be executed whenever the animation completes.\r
+        * @param String|Number speed (optional) 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).\r
+        * @param Function callback (optional) A function to be executed whenever the animation completes.\r
         * @cat Effects/Animations\r
         */\r
        animate: function(prop,speed,callback) {\r