我有一个刷卡器,我希望能够动态切换progress
参数(我正在使用swiper-smooth-progress
插件)。
我像这样初始化了swiper:
var mySwiper = $('.swiper-container').swiper({
progress: false; //slides just slide horizontally
});
此时 swiper-smooth-progress 插件没有启用,所以幻灯片是从右向左滑动的。到目前为止,一切都很好。
但是,在更改progress
参数后:
var newValue = true;
mySwiper.params.progress = newValue;
mySwiper.reInit();
幻灯片不会随着新效果移动。progress
通过查看mySwiper.params.progress
并看到它是 now ,我已经验证了是用新参数设置的true
。那么问题来了:新的进度效果是可以动态实现的,还是需要销毁slilder,用新的参数新建一个?