Created
March 2, 2009 23:19
-
-
Save illiphilli/73068 to your computer and use it in GitHub Desktop.
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
var tabView = new YAHOO.widget.TabView('fadetabs'); | |
tabView.contentTransition = function(newTab, oldTab) { | |
YAHOO.util.Dom.setStyle(newTab.get('contentEl'),'opacity',0); | |
if ( newTab.anim && newTab.anim.isAnimated() ) { | |
newTab.anim.stop(true); | |
} | |
var hideContent = function() { | |
oldTab.set('contentVisible', false); | |
oldTab.anim.onComplete.unsubscribe(hideContent); | |
}; | |
newTab.anim = newTab.anim || new YAHOO.util.Anim( | |
newTab.get('contentEl'),{},0.5, YAHOO.util.Easing.easeOut); | |
newTab.anim.attributes.opacity = { from: 0, to: 1 }; | |
oldTab.anim = oldTab.anim || new YAHOO.util.Anim( | |
oldTab.get('contentEl'),{},0.5, YAHOO.util.Easing.easeOut ); | |
oldTab.anim.attributes.opacity = { to: 0, from: 1 }; | |
oldTab.anim.onComplete.subscribe(hideContent, this, true); | |
newTab.anim.animate(); | |
oldTab.anim.animate(); | |
newTab.set('contentVisible', true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment