Skip to content
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
12 changes: 6 additions & 6 deletions jquery.floatThead.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@
throw new Error('jQuery.floatThead must be run on a table element. ex: $("table").floatThead();');
}
canObserveMutations = opts.autoReflow && canObserveMutations; //option defaults to false!
var $header = $table.find('thead:first');
var $tbody = $table.find('tbody:first');
var $header = $table.children('thead:first');
var $tbody = $table.children('tbody:first');
if($header.length == 0){
throw new Error('jQuery.floatThead must be run on a table that contains a <thead> element');
}
Expand Down Expand Up @@ -234,7 +234,7 @@
var absoluteToFixedOnScroll = ieVersion <= 9 && !locked && useAbsolutePositioning; //on IE using absolute positioning doesn't look good with window scrolling, so we change position to fixed on scroll, and then change it back to absolute when done.
var $floatTable = $("<table/>");
var $floatColGroup = $("<colgroup/>");
var $tableColGroup = $table.find('colgroup:first');
var $tableColGroup = $table.children('colgroup:first');
var existingColGroup = true;
if($tableColGroup.length == 0){
$tableColGroup = $("<colgroup/>");
Expand Down Expand Up @@ -323,7 +323,7 @@

function setHeaderHeight(){
var headerHeight = 0;
$header.find("tr:visible").each(function(){
$header.children("tr:visible").each(function(){
headerHeight += $(this).outerHeight(true);
});
$sizerRow.outerHeight(headerHeight);
Expand Down Expand Up @@ -808,9 +808,9 @@
},
getRowGroups: function(){
if(headerFloated){
return $floatContainer.find("thead").add($table.find("tbody,tfoot"));
return $floatContainer.children("thead").add($table.children("tbody,tfoot"));
} else {
return $table.find("thead,tbody,tfoot");
return $table.children("thead,tbody,tfoot");
}
}
});
Expand Down