关于Tab切换中嵌套Swiper移动端滑动插件,导致Swiper插件失效的问题
Swiper插件大家都知道的,手机端页面开发过程中,轮播用这个插件灰常方便的!关键是调用简单,大大的提高了开发的效率;
但是在Tab切换中调用,Swiper插件就会出问题,失效了,布局结构如下图:


解决办法:

调用的时候加入observer:true,observeParents:true这两个属性值就完美解决了;
这个是启动动态检查器(OB/观众/观看者),当改变swiper的样式(例如隐藏/显示)或者修改swiper的子元素时,自动初始化swiper。
相关推荐
ghjk0 2020-09-24
PncLogon 2020-09-24
杏仁技术站 2020-09-18
AI人工智能 2020-09-18
木叶 2020-09-11
淼寒儿 2020-09-09
一青年 2020-08-13
JackyCan 2020-08-13
JKjiang 2020-07-30
malonely 2020-07-20
加油奋斗吧 2020-07-04
quanquanxiu 2020-06-16
樱花落瓣 2020-06-01
ITstudied 2020-05-17
yuanxiaogang 2020-05-07
前端学习笔记 2020-05-05
aaLiweipeng 2020-04-18
owilson 2020-04-16