// overwrite the old show method
-$.fn._show = $.fn.show;
+jQuery.prototype._show = jQuery.prototype.show;
/**
* The effects module overloads the show method to now allow
* that are already shown. This can be circumvented by doing this:
* $("p:hidden").show("slow");
*/
-$.fn.show = function(speed,callback){
+jQuery.prototype.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;
+jQuery.prototype._hide = jQuery.prototype.hide;
/**
* but is just the opposite.
* $("p:visible").hide("slow");
*/
-$.fn.hide = function(speed,callback){
+jQuery.prototype.hide = function(speed,callback){
return speed ? this.animate({
height: "hide",
width: "hide",
* the width - creating a neat sliding effect.
* $("p:hidden").slideDown("slow");
*/
-$.fn.slideDown = function(speed,callback){
+jQuery.prototype.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){
+jQuery.prototype.slideUp = function(speed,callback){
return this.animate({height: "hide"}, speed, callback);
};
* to a fully visible, state.
* $("p:hidden").fadeIn("slow");
*/
-$.fn.fadeIn = function(speed,callback){
+jQuery.prototype.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){
+jQuery.prototype.fadeOut = function(speed,callback){
return this.animate({opacity: "hide"}, speed, callback);
};
/**
* ...
*/
-$.fn.fadeTo = function(speed,to,callback){
+jQuery.prototype.fadeTo = function(speed,to,callback){
return this.animate({opacity: to}, speed, callback);
};
/**
*
*/
-$.fn.animate = function(prop,speed,callback) {
+jQuery.prototype.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 );
+ var e = new jQuery.fx( this, jQuery.speed(speed,callback,i++), p );
if ( prop[p].constructor == Number )
e.custom( e.cur(), prop[p] );
else
});
};
-$.speed = function(s,o,i) {
+jQuery.speed = function(s,o,i) {
o = o || {};
if ( o.constructor == Function )
o = { complete: o };
var ss = {"slow":600,"fast":200};
- o.duration = s.constructor == Number ? s : ss[s] || 400;
+ o.duration = (s && s.constructor == Number ? s : ss[s]) || 400;
// Queueing
o.oldComplete = o.complete;
o.complete = function(){
- $.dequeue(this, "fx");
+ jQuery.dequeue(this, "fx");
if ( o.oldComplete && o.oldComplete.constructor == Function )
o.oldComplete.apply( this );
};
return o;
};
-$.queue = {};
+jQuery.queue = {};
-$.dequeue = function(elem,type){
+jQuery.dequeue = function(elem,type){
type = type || "fx";
if ( elem.queue && elem.queue[type] ) {
}
};
-$.fn.queue = function(type,fn){
+jQuery.prototype.queue = function(type,fn){
if ( !fn ) {
fn = type;
type = "fx";
});
};
-$.setAuto = function(e,p) {
+jQuery.setAuto = function(e,p) {
var a = e.style[p];
- var o = $.css(e,p);
+ var o = jQuery.css(e,p);
e.style[p] = "auto";
- var n = $.css(e,p);
+ var n = jQuery.css(e,p);
if ( o != n )
e.style[p] = a;
};
* people. You've been warned.
*/
-$.fx = function( elem, options, prop ){
+jQuery.fx = function( elem, options, prop ){
var z = this;
// Get the current size
z.cur = function(){
- return parseFloat( $.css(z.el,prop) );
+ return parseFloat( jQuery.css(z.el,prop) );
};
// Start an animation from one number to another
};
// IE has trouble with opacity if it doesn't have layout
- if ( $.browser == "msie" && !z.el.currentStyle.hasLayout )
+ if ( jQuery.browser == "msie" && !z.el.currentStyle.hasLayout )
y.zoom = 1;
// Remember the overflow of the element
// If the element was shown, and not using a custom number,
// set its height and/or width to auto
if ( (prop == "height" || prop == "width") && z.o.auto )
- $.setAuto( z.el, prop );
+ jQuery.setAuto( z.el, prop );
// If a callback was provided, execute it
- if( z.o.complete.constructor == Function ) {
+ if( z.o.complete && z.o.complete.constructor == Function ) {
// Yes, this is a weird place for this, but it needs to be executed
// only once per cluster of effects.