Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix header not disappearing after table out of view #82

Merged
merged 1 commit into from
Apr 28, 2014
Merged
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
6 changes: 3 additions & 3 deletions jquery.floatThead.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@
}
var top, left, tableHeight;

tableHeight = $table.outerHeight();
if(locked && useAbsolutePositioning){ //inner scrolling, absolute positioning
if (tableContainerGap >= scrollingContainerTop) {
var gap = tableContainerGap - scrollingContainerTop;
Expand All @@ -504,7 +505,6 @@
}
left = 0;
} else if(!locked && useAbsolutePositioning) { //window scrolling, absolute positioning
tableHeight = $table.outerHeight();
if(windowTop > floatEnd + tableHeight + captionScrollOffset){
top = tableHeight - floatContainerHeight + captionScrollOffset; //scrolled past table
} else if (tableOffset.top > windowTop + scrollingTop) {
Expand All @@ -516,7 +516,7 @@
}
left = 0;
} else if(locked && !useAbsolutePositioning){ //inner scrolling, fixed positioning
if (tableContainerGap > scrollingContainerTop) {
if (tableContainerGap > scrollingContainerTop || scrollingContainerTop - tableContainerGap > tableHeight) {
top = tableOffset.top - windowTop;
unfloat();
} else {
Expand Down Expand Up @@ -692,4 +692,4 @@
});
return this;
};
})(jQuery);
})(jQuery);