Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions lib/jquery.easytabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 ) {
Expand Down Expand Up @@ -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() });
Expand Down