Swiper中文论坛

标题: swiper插件zoom案例bug [打印本页]

作者: empty_back    时间: 2017-5-15 16:40
标题: swiper插件zoom案例bug
通过myswiper.prependSlide()方法新创建出来的slide在放大的时候不能拖动查看
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>Swiper demo</title>
  6.     <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">

  7.     <!-- Link Swiper's CSS -->
  8.     <link rel="stylesheet" href="dist/css/swiper.min.css">

  9.     <!-- Demo styles -->
  10.     <style>
  11.     html, body {
  12.         position: relative;
  13.         height: 100%;
  14.     }
  15.     body {
  16.         background: #000;
  17.         font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  18.         font-size: 14px;
  19.         color:#000;
  20.         margin: 0;
  21.         padding: 0;
  22.     }
  23.     .swiper-container {
  24.         width: 100%;
  25.         height: 100%;
  26.     }
  27.     .swiper-slide {
  28.         overflow: hidden;
  29.     }
  30.     </style>
  31. </head>
  32. <body>
  33.     <!-- Swiper -->
  34.     <div class="swiper-container">
  35.         <div class="swiper-wrapper">
  36.             
  37.         </div>
  38.         <!-- Add Pagination -->
  39.         <div class="swiper-pagination swiper-pagination-white"></div>
  40.         <!-- Add Navigation -->
  41.         <div class="swiper-button-prev"></div>
  42.         <div class="swiper-button-next"></div>
  43.     </div>

  44.     <!-- Swiper JS -->
  45.     <script src="dist/js/swiper.min.js"></script>

  46.     <!-- Initialize Swiper -->
  47.     <script>
  48.     var swiper = new Swiper('.swiper-container', {
  49.         zoom: true,
  50.         pagination: '.swiper-pagination',
  51.         nextButton: '.swiper-button-next',
  52.         prevButton: '.swiper-button-prev'
  53.     });
  54.     for(var i=0;i<4;i++){
  55.         swiper.appendSlide('<div class="swiper-slide"><div class="swiper-zoom-container"><img src="http://lorempixel.com/800/800/sports/1"></div></div>');
  56.     }
  57.     swiper.update();
  58.    
  59.     </script>
  60. </body>
  61. </html>
复制代码



作者: Henry_hmy    时间: 2017-5-16 12:12
大兄弟,请问你这个问题解决了么?
作者: Henry_hmy    时间: 2017-5-16 15:10
我也遇到这个问题了。
作者: binglang31    时间: 2017-8-21 15:54


我也遇到这个问题了。




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