Skip to content
Open
Show file tree
Hide file tree
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
36 changes: 23 additions & 13 deletions jquery.fixedheadertable.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
};

var settings = {};
var body = undefined;
var header = undefined;
var footer = undefined;

// public methods
var methods = {
Expand Down Expand Up @@ -332,23 +335,30 @@
$self.bind('scroll', function() {
if (settings.fixedColumns > 0) {
var $fixedColumns = $wrapper.find('.fht-fixed-column');
var margin = -$self.scrollTop();

if (body === undefined) {
body = $fixedColumns.find('.fht-tbody table');
}
body.css({
'margin-top': margin
});
}

$fixedColumns.find('.fht-tbody table')
.css({
'margin-top': -$self.scrollTop()
});
if (header === undefined) {
header = $thead.find('table');
}
header.css({
'margin-left': -this.scrollLeft
});

$thead.find('table')
.css({
if (settings.footer || settings.cloneHeadToFoot) {
if (footer === undefined) {
footer = $tfoot.find('table');
}
footer.css({
'margin-left': -this.scrollLeft
});

if (settings.footer || settings.cloneHeadToFoot) {
$tfoot.find('table')
.css({
'margin-left': -this.scrollLeft
});
}
});
},
Expand Down Expand Up @@ -703,4 +713,4 @@

};

})(jQuery);
})(jQuery);
Loading