首页 > 解决方案 > 猫头鹰旋转木马自由滑动移动

问题描述

我正在尝试将 Owl-Carousel 与免费物品推送一起使用,并使用用户的总控制器,但是当用户滑动它时,这些物品正在移动到边框..

例子:

Item 1 - Item 2 - Item 3 - Item 4(only half is showing)...

所以我只想推一点,它正在发生:

Item 2 - Item 3 - Item 5(only half is showing)...

我想完全控制旋转木马,如果我稍微推动一下,显示如下:

Item 1(only half) - item 2 - item 3 - item 4

我试图尽可能地解决我的问题,我只想让项目不要进入边界,即使用户只是推动了一点旋转木马..

我的配置是:

      <script>
            $('.owl-carousel').owlCarousel({
                margin:12,
                checkVisible: false,
                loop: true,
                responsive:{
                    0:{                     
                        items:3,
                        margin:4,
                        autoWidth:false,
                    },
                    426:{
                        items:3,
                        margin:8,
                    },
                    600:{
                        items:2,
                        margin:8,
                    },
                    700:{
                        items:4,
                        margin:12,
                        autoWidth:true,
                    },
                }
            });
        </script>

我尝试了 freeDrag 和 pullDrag 选项,但没有按预期工作..

标签: javascriptjqueryowl-carousel

解决方案


推荐阅读