我有一个分组在表格中的项目列表,比如说 30,我想要做的是以下内容:
- 从底部到顶部自动垂直滚动,无需按钮单击或鼠标事件
这是我使用的代码:
function scrolling(){
$('#scrollup table').animate(
{
top: '-=10'
},
1000,
'linear',
function(){
if($('#scrollup table tr:last').offset().top<0){
$('#scrollup table tr:first').remove();
$('#scrollup table tr:last').after('<tr>'+$('#scrollup table tr:first').html()+'</tr>');
}
}
);
}
$(document).ready(function(){
setInterval('scrolling()',200)
});
你能告诉我我错过了什么或问题出在哪里吗?