Skip to content

Instantly share code, notes, and snippets.

@illiphilli
Created March 2, 2009 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save illiphilli/73068 to your computer and use it in GitHub Desktop.
Save illiphilli/73068 to your computer and use it in GitHub Desktop.
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