jquery文字上下滚动的实现方法_jquery
来源:懂视网
责编:小采
时间:2020-11-27 21:07:55
jquery文字上下滚动的实现方法_jquery
jquery文字上下滚动的实现方法_jquery: 代码如下://上下滚动 var textRoll=function(){ $('#notice p:last').css({'height':'0px','opacity': '0'}).insertBefore('#notice p:first').animate({'height':'35px','opacity': '1'}, 'slow',
导读jquery文字上下滚动的实现方法_jquery: 代码如下://上下滚动 var textRoll=function(){ $('#notice p:last').css({'height':'0px','opacity': '0'}).insertBefore('#notice p:first').animate({'height':'35px','opacity': '1'}, 'slow',

代码如下:
//上下滚动
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');});
}
$(function(){
//触发上下文字滚动事件
var roll=setInterval('textRoll()',4000);
$("#notice p").hover(function() {
clearInterval(roll);
}, function() {
roll = setInterval('textRoll()', 4000)
});
});
jquery文字上下滚动的实现方法_jquery
jquery文字上下滚动的实现方法_jquery: 代码如下://上下滚动 var textRoll=function(){ $('#notice p:last').css({'height':'0px','opacity': '0'}).insertBefore('#notice p:first').animate({'height':'35px','opacity': '1'}, 'slow',