<div class="scroll_screen">
<ul>
<li>第一条数据</li>
<li>第二条数据</li>
<li>第三条数据</li>
<li>第四条数据</li>
<li>第五条数据</li>
</ul>
</div>
<style>
.scroll_screen{
height: 100px;
overflow: hidden;
}
ui{
list-style: none;
height: 100%;
}
li{
list-style: none;
line-height: 30px;
}
</style>
function autoScroll() {
$(".scroll_screen ul").animate({
marginTop: "-60px"
}, 3000,'linear', function () {
$(this).css({ marginTop: "0px" }).find("li:first").appendTo(this);
})
}
$(function () {
if ($(".scroll_screen ul li").length > 2) {
setInterval('autoScroll()', 1000);
}
})
09-05
1468
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交