html - jquery table header clone issue -
i trying fix table header using jquery clone function. clone function works before scroll header not visible. after scroll cloned table works properly. need show table header before scroll , cloned table header after scroll
var tableoffset = $("#mytable").offset().top; var $header = $("#mytable > thead").clone(); var $fixedheader = $("#header-fixed").append($header); $(".table-container").bind("scroll", function () { var offset = $(this).scrolltop(); if (offset >= tableoffset && $fixedheader.is(":hidden")) { $fixedheader.fadein(2000); } else if (offset < tableoffset) { $fixedheader.hide(); } });
Comments
Post a Comment