【发布时间】:2015-03-29 20:04:11
【问题描述】:
我有这个表格和下面的脚本。主要思想是每 3 秒更改一次表行中的数据......所以第一次它将是 1,3 秒后它将是 2,依此类推。当我使用这个脚本数据变得疯狂(显示第一行就是这样)。有人可以帮助我并告诉我我需要改变什么吗?
HTML
<table>
<tr>
<th>naslov1</th>
<th>naslov2</th>
<th>naslov3</th>
</tr>
@for (int i = 0; i < 5; i++)
{
<tbody id="tableslide">
<tr>
<td>test_@i</td>
<td>test_@i</td>
<td>test_@i</td>
</tr>
</tbody>
}
</table>
Javascript
<script>
$(function () {
$("#tableslide > tr:gt(0)").hide();
setInterval(function () {
$('#tableslide >tr:first')
.slideToggle(1)
//.fadeOut(300)
.next()
//.fadeIn(300)
.slideToggle(1)
.end()
.appendTo('#tableslide');
</script>
}, 3000);
});
我想在一张幻灯片上显示前三行...然后是后两行
【问题讨论】:
-
When i use this script data get crazy- 这是一个非常模糊的错误描述。 -
它们只显示一行,然后什么也没有
标签: javascript jquery