Owl Carousel 文字自动水平滚动效果
  • 分享到微信朋友圈
    X

本文介绍如何使用Owl Carousel v2.2.1制作文字自动水平滚动效果。

主要js

<script>
    $('.owltxt').owlCarousel({
        autoplay: true,
        autoplayTimeout: 3000,
        autoplayHoverPause: false,
        navText: ['<', '>'],
        dots: false,
        loop: true,
        margin: 12,
        responsive: {
            0: {
                items: 1
            },
            600: {
                items: 1
            },
            1000: {
                items: 1
            }
        }
    })

    var owl = $('.owltxt');
    owl.owlCarousel();
    $('.next').click(function () {
        owl.trigger('next.owl.carousel');
    })
    $('.prev').click(function () {
        owl.trigger('prev.owl.carousel');
    }) 
    
    </script>