站长资源网络编程
jquery文字上下滚动的实现方法
简介复制代码 代码如下://上下滚动var textRoll=function()).insertBefore('#notice p:first').animate({'height':'
复制代码 代码如下:
//上下滚动
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)
});
});
上一篇:JS实现网页百叶窗效果