当我单击 Owl Carousel slider 的下一个或上一个按钮时,我只想滚动 4 个元素。
slider 的JS如下:
$(".similarproducts").owlCarousel({
items :5, //10 items above 1000px browser width
itemsDesktop : [1000,3], //5 items between 1000px and 901px
itemsDesktopSmall : [900,3], // betweem 900px and 601px
itemsTablet: [600,2], //2 items between 600 and 0
itemsMobile : [480,1] ,
navigation:true,
pagination:false,
scrollPerPage : true,
});
我使用了 scrollPerPage: true
但当我单击下一个按钮时,它会滑动 5 个元素,但我只想滑动 4 个元素。另外,当 slider 到达终点时,我希望它弹起并且不再移动。
最佳答案
只需将您的商品数量从 5 更改为 4 项目:4 希望能完成
关于javascript - 使用 Owl Carousel 将 slider 的滚动设置为仅 4 个元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32285923/