-$.speed = function(s,o) {
- if ( o && o.constructor == Function ) { o = { onComplete: o }; }
- o = o || {};
- var ss = {"crawl":1200,"xslow":850,"slow":600,"medium":400,"fast":200,"xfast":75,"normal":400};
- o.duration = typeof s == "number" ? s : ss[s] || 400;
-
- o.oldComplete = o.onComplete;
- o.onComplete = function(){
- $.dequeue(this, 'fx');
- if ( o.oldComplete && o.oldComplete.constructor == Function ) {
- $.apply( this, o.oldComplete );
+// overwrite the old show method
+$.fn._show = $.fn.show;
+
+/**
+ * The effects module overloads the show method to now allow
+ * for a speed to the show operation. What actually happens is
+ * that the height, width, and opacity to the matched elements
+ * are changed dynamically. The only three current speeds are
+ * "slow", "normal", and "fast". For example:
+ * $("p").show("slow");
+ * Note: You should not run the show method on things
+ * that are already shown. This can be circumvented by doing this:
+ * $("p:hidden").show("slow");
+ */
+$.fn.show = function(speed,callback){
+ return speed ? this.animate({
+ height: "show", width: "show", opacity: "show"
+ }, speed, callback) : this._show();
+};
+
+// We're overwriting the old hide method
+$.fn._hide = $.fn.hide;
+
+
+/**
+ * The hide function behaves very similary to the show function,
+ * but is just the opposite.
+ * $("p:visible").hide("slow");
+ */
+$.fn.hide = function(speed,callback){
+ return speed ? this.animate({
+ height: "hide",
+ width: "hide",
+ opacity: "hide"
+ }, speed, callback) : this._hide();
+};
+
+/**
+ * This function increases the height and opacity for all matched
+ * elements. This is very similar to 'show', but does not change
+ * the width - creating a neat sliding effect.
+ * $("p:hidden").slideDown("slow");
+ */
+$.fn.slideDown = function(speed,callback){
+ return this.animate({height: "show"}, speed, callback);
+};
+
+/**
+ * Just like slideDown, only it hides all matched elements.
+ * $("p:visible").slideUp("slow");
+ */
+$.fn.slideUp = function(speed,callback){
+ return this.animate({height: "hide"}, speed, callback);
+};
+
+/**
+ * Adjusts the opacity of all matched elements from a hidden,
+ * to a fully visible, state.
+ * $("p:hidden").fadeIn("slow");
+ */
+$.fn.fadeIn = function(speed,callback){
+ return this.animate({opacity: "show"}, speed, callback);
+};
+
+/**
+ * Same as fadeIn, but transitions from a visible, to a hidden state.
+ * $("p:visible").fadeOut("slow");
+ */
+$.fn.fadeOut = function(speed,callback){
+ return this.animate({opacity: "hide"}, speed, callback);
+};
+
+/**
+ * ...
+ */
+$.fn.fadeTo = function(speed,to,callback){
+ return this.animate({opacity: to}, speed, callback);
+};
+
+/**
+ *
+ */
+$.fn.animate = function(prop,speed,callback) {
+ return this.queue(function(){
+ var i = 0;
+ for ( var p in prop ) {
+ var e = new fx( this, $.speed(speed,callback,i++), p );
+ if ( prop[p].constructor == Number )
+ e.custom( e.cur(), prop[p] );
+ else
+ e[ prop[p] ]();