基于jquery的文字向上跑动类似跑马灯的效果
更新时间:2014年09月22日 17:13:16 投稿:whsnow
这是一个基于jquery的文字向上跑动,其效果类似跑马灯,在某些情况下还是比较实用的,下面与大家分享下实现代码
想实现一个类似跑马灯的效果,发现跑马灯有空格.效果也不美观,于是用jquery写了个
页面代码
<div class="recordList"> <ul class="tpl-rotate-recordList" style="margin-top: 0px;"> <li class="tpl-rotate-recordList-item"> 恭喜187****5204获得1000RBM </li> <li class="tpl-rotate-recordList-item"> 恭喜137****1372获得1000RBM </li> <li class="tpl-rotate-recordList-item"> 恭喜156****0276获得1000RBM </li> <li class="tpl-rotate-recordList-item"> 恭喜139****9856获得1000RBM </li> <li class="tpl-rotate-recordList-item"> 恭喜136****0580获得1000RBM </li> <li class="tpl-rotate-recordList-item"> 恭喜136****0580获得1000RBM </li> <li class="tpl-rotate-recordList-item"> 恭喜138****8118获得1000RBM </li> <li class="tpl-rotate-recordList-item"> 恭喜136****5555获得1000RBM </li> <li class="tpl-rotate-recordList-item"> 恭喜136****0580获得1000RBM </li> <li class="tpl-rotate-recordList-item"> 恭喜136****0580获得1000RBM </li> </ul> </div>
js代码
/*自动轮换xuyw*/
var AutoScroll = function(a) {
$(a).find("ul:first").animate( {
marginTop : "-20px"
}, 500, function() {
$(this).css( {
marginTop : "0px"
}).find("li:first").appendTo(this)
})
}
if ($(".recordList ul li").length > 0) {
setInterval('AutoScroll(".recordList")', 2000)
} else {
$(".recordList").hide()
}
相关文章
jquery load事件(callback/data)使用方法及注意事项
jquery load 事件使用方法,在网上有很多的相关介绍文章,不过大同小异,本文老生长谈,也介绍一下load事件使用方法,感兴趣的朋友可以了解下,或许对你学习jquery有所帮助2013-02-02
jquery异常问题Uncaught TypeError: $(...).on is not a funct
这篇文章主要介绍了jquery异常问题Uncaught TypeError: $(...).on is not a function,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教2022-11-11
jquery插件lazyload.js延迟加载图片的使用方法
lazyload.js是一个基于JQuery的插件,可以用来缓冲加载图片。下面介绍这个插件的使用方法2014-02-02
jQuery EasyUI API 中文文档 - Dialog对话框
jQuery EasyUI API 中文文档 - Dialog对话框使用说明,需要的朋友可以参考下。2011-11-11


最新评论