如何使用Swiper在同一个页面上多个轮播组件
1个回答
2016-09-12
展开全部
现在切入正题~~~这几天写前台的页面发现Swiper非常强大,公司项目又要求弄成响应式的所以项目里有整合Bootstrap,Swiper目前在用的过程中没有发现和Bootstrap有冲突,但是在其中的一个页面需要多个轮播组件。所以直接上代码吧
页面代码:
[html] view plain copy
<div class="swiper-container hidden-xs swiper-container1">
<div class="swiper-wrapper">
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/business1.png);"></div>
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/business1.png);"></div>
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/business1.png);"></div>
</div>
<div class="swiper-pagination swiper-p1"></div>
</div>
<div class="swiper-container visible-xs-block swiper-container2">
<div style="height:51px;"> </div>
<div class="swiper-wrapper">
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/index0-mob.jpg);"></div>
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/index0-mob.jpg);"></div>
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/index0-mob.jpg);"></div>
</div>
<div class="swiper-pagination swiper-p2"></div>
</div>
页面代码:
[html] view plain copy
<div class="swiper-container hidden-xs swiper-container1">
<div class="swiper-wrapper">
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/business1.png);"></div>
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/business1.png);"></div>
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/business1.png);"></div>
</div>
<div class="swiper-pagination swiper-p1"></div>
</div>
<div class="swiper-container visible-xs-block swiper-container2">
<div style="height:51px;"> </div>
<div class="swiper-wrapper">
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/index0-mob.jpg);"></div>
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/index0-mob.jpg);"></div>
<div class="swiper-slide lwc-imghandle" style="background-image:url(__IMG__/HtmlTemplate/index0-mob.jpg);"></div>
</div>
<div class="swiper-pagination swiper-p2"></div>
</div>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询