简要咨询咨询QQ网站导航网站搜索手机站点联系我们设为首页加入收藏 

基于jquery的文字向上跑动类似跑马灯的效果

来源:易贤网   阅读:837 次  日期:2016-06-20 09:50:49

温馨提示:易贤网小编为您整理了“基于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()

}

更多信息请查看脚本栏目
点此处就本文及相关问题在本站进行非正式的简要咨询(便捷快速)】     【点此处查询各地各类考试咨询QQ号码及交流群
上一篇:dos中一些常用命令的errorlevel返回值
下一篇:excel vba 高亮显示当前行代码
易贤网手机网站地址:基于jquery的文字向上跑动类似跑马灯的效果
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!