美文网首页
文字滚动

文字滚动

作者: yyshang | 来源:发表于2019-06-28 14:31 被阅读0次

jq写的

//文字上下滚动
(function($){
    $.fn.txtscroll=function(index,item){
        var _wrap=$(this);
        var _interval=2000;
        var _moving;
        _wrap.hover(function(){
            clearInterval(_moving);
        },function(){
            _moving=setInterval(function(){
                var _field=_wrap.find('li:first');
                var _h=_field.outerHeight(true);
                _field.animate({marginTop:-_h+'px'},600,function(){
                    _field.css('marginTop',0).appendTo(_wrap);
                })
            },_interval)
        }).trigger('mouseleave');
    }
})(jQuery);
$(".list-word").txtscroll();

swiper

  var mySwiper = new Swiper ('.module_191', {
                    direction: 'vertical', // 垂直切换选项
                    loop: true,
                     slidesPerView: 3,//需要显示的个数
                    autoplay:{//是否自动轮播
                        delay: 2000,
                        disableOnInteraction: false,
                    }
                })
            }

相关文章

网友评论

      本文标题:文字滚动

      本文链接:https://www.haomeiwen.com/subject/lsgscctx.html