- 试了几种方法,还是 translateY 比较靠谱
- 放弃 ie
// 固定头部
var thead_top = $('thead').offset().top;
$(window).scroll(function() {
var sctop = $(this).scrollTop();
if(sctop > 60){
var ty = sctop - thead_top;
thead.css({'transform':'translateY('+ ty +'px)'});
} else{
thead.css({'transform':'translateY(0px)'});
}
})