最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
js实现文字向上轮播功能的教程
时间:2017-01-16 编辑:简简单单 来源:一聚教程网
话不多说,请看实现代码:
代码如下 | 复制代码 |
*{ margin:0; padding:0; } .lunbo{ position: relative; width: 600px; height: 50px; border:1px solid red; overflow: hidden; } ul{ position:absolute; left: 0; top:0; width: 600px; height: auto; } ul li{ width: 600px; height: 50px; line-height: 50px; font-size:20px; color:#333; text-align: center }
function lunbo(id,height){ var ul=$(id); var liFirst=ul.find('li:first'); $(id).animate({top:height}).animate({"top":0},0,function(){ var clone=liFirst.clone(); $(id).append(clone); liFirst.remove(); }) } setInterval("lunbo('ul','-50px')",3000) |