Swiper中文论坛

标题: swiper如何嵌套 [打印本页]

作者: 六月天123    时间: 2016-1-31 13:29
标题: swiper如何嵌套
就是说我想做个单页网站,从上到下一共五个页面,第一个页面嵌套进去一个左右切换的banner,创建函数的时候class不就冲突了嘛  这怎么解决

作者: 789998    时间: 2016-2-1 13:48
给容器再加个类

  1. <div class="swiper-container swiper-container-v">
  2.     <div class="swiper-wrapper ">
  3.         <div class="swiper-slide ">
  4.             <div class="swiper-container swiper-container-h" >
  5.                 <div class="swiper-wrapper swiper-wrapper-h">
  6.                     <div class="swiper-slide"></div>
  7.                     <div class="swiper-slide"></div>
  8.                 </div>
  9.             </div>
  10.         </div>
  11.         <div class="swiper-slide "></div>
  12.         <div class="swiper-slide "></div>  
  13.         <div class="swiper-slide "></div>         
  14.     </div>
  15. </div>
  16. <script>
  17. var swiperV = new Swiper('.swiper-container-h', {
  18.         pagination: '.swiper-pagination-h',
  19.         mousewheelControl : true,
  20. });
  21. var swiperV = new Swiper('.swiper-container-v', {
  22.         pagination: '.swiper-pagination-v',
  23.         direction: 'vertical',
  24.         mousewheelControl : true,
  25. });
  26. </script>
复制代码







欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/) Powered by Discuz! X3.2