From 47878003891ee7b9cd829f87edfb266262ebd00d Mon Sep 17 00:00:00 2001 From: DenisPetrov Date: Tue, 14 Oct 2014 18:59:28 +0400 Subject: [PATCH] correct floatThead-container width when scrollContainer overflow is hidden --- dist/jquery.floatThead.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dist/jquery.floatThead.js b/dist/jquery.floatThead.js index aaea424..4ae5166 100644 --- a/dist/jquery.floatThead.js +++ b/dist/jquery.floatThead.js @@ -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);