jquery - 为什么将布局更改为响应式时滑动器不起作用?
问题描述
我对演示有同样的问题:https
:
//codepen.io/codenowa/pen/rNVyjGK 为什么将布局更改为响应模式(chrome)并且不重新加载页面,Swiper 无法拖动?
mySwiper = new Swiper ('.swiper-container', {
direction: 'horizontal',
loop: false,
spaceBetween: 10,
width : sizeImg,
swipe: true,
watchOverflow:true,
preventClicks : false,
preventClicksPropagation : false,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
//And if we need scrollbar
scrollbar: {
el: '.swiper-scrollbar',
draggable: true,
},
on: {
sliderMove: function () {
$.sidr('close', 'sidr');
},
}
});
解决方案
尝试使用这个版本
https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.1.0/js/swiper.js
Codepen 中的示例:
https://codepen.io/dnjstlr555/pen/qpwRyG
推荐阅读
- python - Python 上下文管理器
- python - 在 Ariadne GraphQL 响应中添加标头
- .net - 如何从 NuGet 安装包
- android - 运行后我无法使用 Flutter 运行我的第一个应用程序我收到此错误
- flutter - 当我运行我的代码时,为什么在 _WidgetsAppState 中找不到路由 RouteSettings("/coursePage", null) 的生成器
- reactjs - Tailwind css 在部署时不工作
- winapi - 如何在winapi-rs中获取IWICImagingFactory的实例
- ruby-on-rails - 地理编码器(alexreisner 版本)为我返回不正确的坐标
- nlp - RuntimeError:堆栈期望每个张量大小相等,但在条目 0 处得到 [5391],在条目 1 处得到 [8441]
- c++ - 从链表中的 getNext()、getPrev() 或 getData() 函数返回 NULL