Skip to content

Instantly share code, notes, and snippets.

@illiphilli
illiphilli / index.html
Created November 14, 2012 23:43
A CodePen by Phillip Ball. CSS Transition auto-height menu
<div class="menu">
<li>
<a href="#" class="trigger">Item 1</a>
<div class="ddpanel">
<p>
Here is some content that spans multiple lines<br />
Here is some content that spans multiple lines<br />
Here is some content that spans multiple lines<br />
Here is some content that spans multiple lines<br />
Here is some content that spans multiple lines<br />
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);