jquery.fixedtableheader-1.0.3/0002755000175500017600000000000013071705507016430 5ustar debaclelocal_srcjquery.fixedtableheader-1.0.3/LICENSE0000644000175500017600000000205613071705507017436 0ustar debaclelocal_srcMIT License Copyright (c) 2017 Mustafa OZCAN Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. jquery.fixedtableheader-1.0.3/src/0002755000175500017600000000000013071705507017217 5ustar debaclelocal_srcjquery.fixedtableheader-1.0.3/src/jquery.fixedtableheader.js0000644000175500017600000000521413071705507024353 0ustar debaclelocal_src/* Copyright (c) 2009 Mustafa OZCAN (http://www.mustafaozcan.net) * Released under the MIT license * Version: 1.0.3 * Requires: jquery.1.3+ */ jQuery.fn.fixedtableheader = function (options) { var settings = jQuery.extend({ headerrowsize: 1, highlightrow: false, highlightclass: "highlight" }, options); this.each(function (i) { var $tbl = $(this); var $tblhfixed = $tbl.find("tr:lt(" + settings.headerrowsize + ")"); var headerelement = "th"; if ($tblhfixed.find(headerelement).length == 0) headerelement = "td"; if ($tblhfixed.find(headerelement).length > 0) { $tblhfixed.find(headerelement).each(function () { $(this).css("width", $(this).width()); }); var $clonedTable = $tbl.clone().empty(); var tblwidth = GetTblWidth($tbl); $clonedTable.attr("id", "fixedtableheader" + i).css({ "position": "fixed", "top": "0", "left": $tbl.offset().left }).append($tblhfixed.clone()).width(tblwidth).hide().appendTo($("body")); if (settings.highlightrow) $("tr:gt(" + (settings.headerrowsize - 1) + ")", $tbl).hover(function () { $(this).addClass(settings.highlightclass); }, function () { $(this).removeClass(settings.highlightclass); }); $(window).scroll(function () { $clonedTable.css({ "position": "fixed", "top": "0", "left": $tbl.offset().left - $(window).scrollLeft() }); var sctop = $(window).scrollTop(); var elmtop = $tblhfixed.offset().top; if (sctop > elmtop && sctop <= (elmtop + $tbl.height() - $tblhfixed.height())) $clonedTable.show(); else $clonedTable.hide(); }); $(window).resize(function () { if ($clonedTable.outerWidth() != $tbl.outerWidth()) { $tblhfixed.find(headerelement).each(function (index) { var w = $(this).width(); $(this).css("width", w); $clonedTable.find(headerelement).eq(index).css("width", w); }); $clonedTable.width($tbl.outerWidth()); } $clonedTable.css("left", $tbl.offset().left); }); } }); function GetTblWidth($tbl) { var tblwidth = $tbl.outerWidth(); return tblwidth; } }; jquery.fixedtableheader-1.0.3/README.md0000644000175500017600000000070613071705507017710 0ustar debaclelocal_src# jquery.fixedtableheader jQuery Fixed Table Header Plugin The plugin fixes header row of table without div overflow. It fixes header row when scroll down the page. You can use fixedtableheader plugin with ASP.NET DataGrid or GridView. For demo and details: [http://www.mustafaozcan.net/en/jquery-fixed-table-header-plugin/](http://www.mustafaozcan.net/en/jquery-fixed-table-header-plugin/) Developed by [Mustafa OZCAN](http://www.mustafaozcan.net) jquery.fixedtableheader-1.0.3/jquery.fixedtableheader.min.js0000644000175500017600000000236313071705507024350 0ustar debaclelocal_src/* Copyright (c) 2009 Mustafa OZCAN (http://www.mustafaozcan.net) * Released under the MIT license * Version: 1.0.3 * Requires: jquery.1.3+ */ jQuery.fn.fixedtableheader=function(a){function c(a){return a.outerWidth()}var b=jQuery.extend({headerrowsize:1,highlightrow:!1,highlightclass:"highlight"},a);this.each(function(a){var d=$(this),e=d.find("tr:lt("+b.headerrowsize+")"),f="th";if(0==e.find(f).length&&(f="td"),e.find(f).length>0){e.find(f).each(function(){$(this).css("width",$(this).width())});var g=d.clone().empty(),h=c(d);g.attr("id","fixedtableheader"+a).css({position:"fixed",top:"0",left:d.offset().left}).append(e.clone()).width(h).hide().appendTo($("body")),b.highlightrow&&$("tr:gt("+(b.headerrowsize-1)+")",d).hover(function(){$(this).addClass(b.highlightclass)},function(){$(this).removeClass(b.highlightclass)}),$(window).scroll(function(){g.css({position:"fixed",top:"0",left:d.offset().left-$(window).scrollLeft()});var a=$(window).scrollTop(),b=e.offset().top;a>b&&a<=b+d.height()-e.height()?g.show():g.hide()}),$(window).resize(function(){g.outerWidth()!=d.outerWidth()&&(e.find(f).each(function(a){var b=$(this).width();$(this).css("width",b),g.find(f).eq(a).css("width",b)}),g.width(d.outerWidth())),g.css("left",d.offset().left)})}})};