Skip to content

Commit

Permalink
correct floatThead-container width when scrollContainer overflow is h…
Browse files Browse the repository at this point in the history
…idden
  • Loading branch information
XAOPT committed Oct 14, 2014
1 parent b3c675a commit 4787800
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dist/jquery.floatThead.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,10 @@
function setFloatWidth(){
var tableWidth = $table.outerWidth();
var width = $scrollContainer.width() || tableWidth;
$floatContainer.width(width - scrollbarOffset.vertical);
var noOffsetWidth = ($scrollContainer.css("overflow-y") != 'hidden')?width - scrollbarOffset.vertical:width;
$floatContainer.width(noOffsetWidth);
if(locked){
var percent = 100 * tableWidth / (width - scrollbarOffset.vertical);
var percent = 100 * tableWidth / (noOffsetWidth);
$floatTable.css('width', percent+'%');
} else {
$floatTable.outerWidth(tableWidth);
Expand Down

0 comments on commit 4787800

Please sign in to comment.