Created
September 13, 2010 05:52
-
-
Save fumikito/576860 to your computer and use it in GitHub Desktop.
Extend MooTools' fade in & out.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Code snipet for fade in & out with MooTools. | |
* @author Takahashi Fumiki | |
* @description | |
*/ | |
Element.prototype.fadeIn = function(display){ | |
if(display == undefined) | |
display = "block"; | |
var fx = new Fx.Morph(this); | |
this.setStyles({ | |
visibility: "visible", | |
display: display, | |
opacity: 0 | |
}); | |
this.fade("in"); | |
}; | |
Element.prototype.fadeOut = function(){ | |
var fx = new Fx.Morph(this); | |
fx.start({ | |
opacity: [1,0] | |
}).chain(function(){ | |
this.start({ | |
display: "none" | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment