我正在使用一个小UI来展示比赛终结者。该计划将信息拉入表格,以帮助保持一切顺利。
function scrolling() {
$('#scrollup table').animate({
top: '-=' + $('#scrollup table tr:last').height()
},
1000,
'linear',
function() {
var offset = $('#scrollup table tr:last').offset().top;
console.log(offset);
if (offset <= 1352) {
$('#scrollup table').css("top", 0);
$('#scrollup table tr:last').after($('#scrollup table tr:first').detach());
}
}
);}
$(document).ready(function() {
setInterval('scrolling()', 1000)
});
我不确定如何保持thead固定并保持平滑滚动。 Demo
答案 0 :(得分:0)
<强> DEMO 强>
只需将以下样式添加到thead
thead{
position:fixed;
background:gray;
}
并且在动画中detach
tr
时,只有detach
tbody
的{{1}}。
tr