https://cnodejs.org/topic/56ef3edd532839c33a99d00e 前端资源

文字滚动

 function txtScroll(){

var $this = $(".scoll-y");

 

    var scrollTimer;
    $this.hover(function(){
        clearInterval(scrollTimer);
    },function(){
        scrollTimer = setInterval(function(){
            scrollNews( $this );
        }, 2000);
    }).trigger("mouseout");
    function scrollNews(obj){
        var $self = obj.find("ul:first");
        var lineHeight = $self.find("li:first").height();
        $self.animate({ "margin-top" : -lineHeight +"px" },600 , function(){
            $self.css({"margin-top":"0px"}).find("li:first").appendTo($self);
        })
    }

}

posted @ 2016-03-24 13:39  乐淘淘zzxh  阅读(127)  评论(0编辑  收藏  举报