基于jQuery实现的单行公告活动轮播效果
废话不多说了,直接给大家贴代码了,具体代码如下所示:
<div class="lunbo123" style="position:relative;height: 45px;overflow: hidden;background-color:white" ;> <ul id="myul" style="margin:6px;padding:0px;position:absolute;width: 700px; 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.bootcss.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; width: 300px; height: 45px; font-size: 20px; } </style>
总结
相关推荐
seoppt 2020-09-13
EdwardSiCong 2020-11-23
85477104 2020-11-17
hhanbj 2020-11-17
81427005 2020-11-11
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
82550495 2020-08-03
tthappyer 2020-08-03
84901334 2020-07-28
tthappyer 2020-07-25
TONIYH 2020-07-22
tztzyzyz 2020-07-20
83510998 2020-07-18
81463166 2020-07-17