PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

jQuery实现的单行公告活动轮播效果示例分享

小云云
小云云 原创
2017-12-30 14:24:03 1177浏览

本文通过实例代码给大家介绍了基于jQuery实现的单行公告活动轮播效果,非常不错,代码简单易懂,具有参考借鉴价值,需要的的朋友参考下吧,希望能帮助到大家。

废话不多说了,直接给大家贴代码了,具体代码如下所示:


<p 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>
</p>
<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>

相关推荐:

10行js代码实现上下滚动公告效果方法

使用jQuery实现页面定时弹出广告效果的功能实现

javascript实现循环广告条效果方法教程

以上就是jQuery实现的单行公告活动轮播效果示例分享的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。