//创建一个函数 在ajax 加载完tbody后 执行
function scrollHead(){var headTr = "";
var tbodyTr ="";
if($(".programeData table tbody tr").length > 0){
headTr=$(".programeData table thead tr");
tbodyTr= $(".programeData table tbody tr:visible");
cloneHead();
}else if($(".qishuData table tbody tr").length > 0){
headTr=$(".qishuData table thead tr");
tbodyTr= $(".qishuData table tbody tr:visible");
cloneHead();
}
function cloneHead() {
var head =$("#ceilingMountedTable table thead");
head.empty();
head.append(headTr.clone(true));
head.find("tr:first>th").each(function(index, element) {
var dataTd = tbodyTr.eq(tbodyTr.length-1).find("td:visible").eq(index);
$(this).width(dataTd.width());
});
head.css({"position":"fixed","top":"0px","background":"#fff","height":"36px","box-shadow":"#b4b4b4 0px 2px 10px"});
}
}
$(window).scroll(function(){
var scrollToph = document.documentElement.scrollTop ||document.body.scrollTop;
var divtopH = $(".dataView").offset().top +40;
var resultH = divtopH - scrollTop;
if( resultH <= 0 ){
$("#ceilingMountedTable").show();
}else if( resultH > 0 ){
$("#ceilingMountedTable").hide();
}
})