jquery文字上下滚动的实现方法

jquery实现文字上下滚动的方法。

代码:

//上下滚动
var textRoll=function(){
$('#notice p:last').css({'height':'0px','opacity': '0'}).insertBefore('#notice p:first').animate({'height':'35px','opacity': '1'}, 'slow', function() { $(this).removeAttr('style');});
} //by www.jbxue.com
$(function(){
//触发上下文字滚动事件
var roll=setInterval('textRoll()',4000);
$("#notice p").hover(function() {
clearInterval(roll);
}, function() {
roll = setInterval('textRoll()', 4000)
});
});

posted @ 2014-01-16 16:53  一觉睡到天黑黑  阅读(230)  评论(0编辑  收藏  举报