HtmL
<div style="height:320px;overflow:hidden">
<table id="tableId" class ='mytable1' style="table-layout:fixed; text-align: center;color:white; width: 100%;">
<thead>
<tr >
<th style="width:5%">序号</th>
<th style="width:10%">姓名</th>
<th style="width:6%">list1</th>
<th style="width:6%">list1</th>
<th style="width:10%">list1</th>
<th style="width:10%">list1</th>
<th style="width:12%;">list1</th>
<th style="width:10%">list1</th>
<th style="width:12%">list1</th>
<th style="width:10%">list1</th>
<th style="width:8%">list1</th>
<th style="width:10%">list1</th>
</tr>
</thead>
<tbody id="rankdetail2">
</tbody>
</table>
</div>
tbody需要自己根据实际情况添加;
JS代码:
setInterval(timerFn,2500);
function timerFn(){
var scrollHeight = $('#rankdetail2').find("tr").outerHeight();
$('#rankdetail2').animate({
marginTop:-scrollHeight,
},500,
function(){
$(this).css({marginTop:"0px",}).find("tr:first").appendTo(this);
});
};