Skip to content

Commit

Permalink
Merge pull request #128 from XAOPT/master
Browse files Browse the repository at this point in the history
floatThead-container width when scrollContainer overflow is hidden
  • Loading branch information
mkoryak committed Oct 15, 2014
2 parents b3c675a + 4787800 commit e0bb475
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 e0bb475

Please sign in to comment.