文字间隔一段时间上下滚动,鼠标悬停与移出监控 && jquery

页面效果

 

html代码

 

JS代码

//上下滚动

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)

                            });

            });

 

 

posted @ 2013-03-22 09:31  关小庆  阅读(199)  评论(0编辑  收藏  举报