一聚教程网:一个值得你收藏的教程网站

热门教程

基于jQuery实现的单行公告活动轮播效果

时间:2022-06-25 17:03:03 编辑:袖梨 来源:一聚教程网

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<div class="lunbo123" style="position:relative;overflow: hidden;background-color:white" ;="">
<ul id="myul" style="margin:6px;padding:0px;position:absolute; height: auto;">
<li>
<a href="" style=" rel=" external="" nofollow"="" rel="external nofollow" text-decoration:="" none;color:="" #000000;="" "="">
<span style="height:36px ; line-height: 36px;">公告test1
</span>
</a>
<br>
</li>
<li>
<a href="" style=" rel=" external="" nofollow"="" rel="external nofollow" text-decoration:="" none;color:="" #000000;="" "="">
<span style="height:36px ; line-height: 36px;">活动test2
</span>
</a>
<br>
</li>
</ul>
</div>
<script src="//cdn.boot<a href=" http:="" www.111com.net="" cssdiv="" css.html"="" target="_blank">css</a>.com/jquery/2.2.2/jquery.js"></script>
<script>
function lunbo123(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("lunbo123('#myul','-45px')", 2500)
</script>
<style>
#myul {
list-style-type: none;
 
 
font-size: 20px;
}
</style>

热门栏目