From f0e33ded20ca4af8fb7a8f111e50d3c7bd8e58f5 Mon Sep 17 00:00:00 2001 From: Andras Rutkai Date: Mon, 31 Mar 2014 20:45:01 +0200 Subject: [PATCH] Bugfix: On fadeIn/fadeOut animation the container's overflow parameter changes to hidden. This may cause problems (as it caused in my site :)) --- lib/jquery.easytabs.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/jquery.easytabs.js b/lib/jquery.easytabs.js index d11c15e..7450d9f 100644 --- a/lib/jquery.easytabs.js +++ b/lib/jquery.easytabs.js @@ -509,7 +509,8 @@ visibleHeight, heightDifference, showPanel, - hash = window.location.hash.match(/^[^\?]*/)[0]; + hash = window.location.hash.match(/^[^\?]*/)[0], + overflowSetting; if (settings.animate) { targetHeight = getHeightForHidden($targetPanel); @@ -529,10 +530,13 @@ // Gracefully animate between panels of differing heights, start height change animation *after* panel change if panel needs to contract, // so that there is no chance of making the visible panel overflowing the height of the target panel if (settings.animate && settings.transitionIn == 'fadeIn') { - if (heightDifference < 0) - $panelContainer.animate({ - height: $panelContainer.height() + heightDifference - }, transitions.halfSpeed ).css({ 'min-height': '' }); + if (heightDifference < 0) { + overflowSetting = $panelContainer.css('overflow'); + $panelContainer.animate({ + height: $panelContainer.height() + heightDifference + }, transitions.halfSpeed ).css({ 'min-height': '' }); + $panelContainer.css('overflow', overflowSetting); + } } if ( settings.updateHash && ! skipUpdateToHash ) { @@ -566,9 +570,11 @@ // so that there is no chance of making the target panel overflowing the height of the visible panel if( settings.animate && settings.transitionOut == 'fadeOut' ) { if( heightDifference > 0 ) { + overflowSetting = $panelContainer.css('overflow'); $panelContainer.animate({ height: ( $panelContainer.height() + heightDifference ) }, transitions.halfSpeed ); + $panelContainer.css('overflow', overflowSetting); } else { // Prevent height jumping before height transition is triggered at midTransition $panelContainer.css({ 'min-height': $panelContainer.height() });