Skip to content

Commit

Permalink
Fixed easytabs height transition error for jquery 1.8 and IE7.
Browse files Browse the repository at this point in the history
  • Loading branch information
JangoSteve committed May 9, 2013
1 parent a3ede87 commit 76253d7
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions lib/jquery.easytabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,23 @@

// this is the only property easytabs changes, so we need to grab its value on each tab change
var display = $targetPanel.css('display'),

// Workaround, because firefox returns wrong height if element itself has absolute positioning
height = $targetPanel
.wrap($('<div>', {position: 'absolute', 'visibility': 'hidden', 'overflow': 'hidden'}))
.css({'position':'relative','visibility':'hidden','display':'block'})
.outerHeight();
outerCloak,
height;

// Workaround with wrapping height, because firefox returns wrong
// height if element itself has absolute positioning.
// but try/catch block needed for IE7 and IE8 because they throw
// an "Unspecified error" when trying to create an element
// with the css position set.
try {
outerCloak = $('<div></div>', {'position': 'absolute', 'visibility': 'hidden', 'overflow': 'hidden'});
} catch (e) {
outerCloak = $('<div></div>', {'visibility': 'hidden', 'overflow': 'hidden'});
}
height = $targetPanel
.wrap(outerCloak)
.css({'position':'relative','visibility':'hidden','display':'block'})
.outerHeight();

$targetPanel.unwrap();

Expand Down

0 comments on commit 76253d7

Please sign in to comment.