javascript - 猫头鹰旋转木马自由滑动移动
问题描述
我正在尝试将 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 选项,但没有按预期工作..
解决方案
推荐阅读
- javascript - Javascript 在本地工作,但不在网络服务器上。(未捕获的 ReferenceError:未定义 jQuery)
- ajax - jQuery 数据表中的“404 - 找不到文件或目录”
- swift - 使用 Swift 5 从项目中的子组获取文件路径
- r - 在 r 中用宏(函数)总结时找不到对象
- kendo-ui - Kendo UI Tabstrip 1 点击
- reactjs - 在初始加载时从状态动态更新组件样式?
- django - 如何在 Python Django 中修复 /accounts/register 处的 UnboundLocalError
- python - 通过在python中迭代来条件匹配行
- android - react expo [未处理的承诺拒绝:错误:尝试使用权限 API,但主机 Activity 未实现 PermissionAwareActivity。]
- go - 可变参数函数的困难