简体   繁体   English

滑动触摸滑块-不滑动

[英]Swiper touch slider - Not sliding

I'm creating a swiper in jQuery. 我在jQuery中创建了一个刷卡器。 Im using Swiper touch slider - It's not working on my main domain. 我正在使用Swiper触摸滑块-在我的主域上不起作用。 Only thing I can think of is that another JS file is overriding it? 我唯一能想到的是另一个JS文件正在覆盖它? But I removed all of my JS files and its still not working. 但是我删除了所有JS文件,但仍然无法正常工作。 Heres the HTML code 继承人的HTML代码

        <div class="device">
        <div class="swiper-button-next"></div>
        <div class="swiper-button-prev"></div>
        <div class="swiper-container" style="cursor: -webkit-grab;">
        <div class="swiper-wrapper" style="width: 3200px; height: 560px; transform: translate3d(-1920px, 0px, 0px); transition-duration: 0.3s;">
        <div class="swiper-slide swiper-slide-duplicate" style="width: 513px; height: 560px;">
        <div class="content-slide">
        <p class="title">Slide with HTML</p>
        <p>You can put any HTML inside of slide with any layout, not only images, even another Swiper!</p>
        </div>
        </div>
        <div class="swiper-slide" style="width: 513px; height: 560px;"> <img src="images/slider1-1.png"> </div>
        <div class="swiper-slide" style="width: 513px; height: 560px;"> <img src="images/slider1-2.png"> </div>
        <div class="swiper-slide swiper-slide-visible swiper-slide-active" style="width: 513px; height: 560px;">
        <div class="content-slide">
        <p class="title">Slide with HTML</p>
        <p>You can put any HTML inside of slide with any layout, not only images, even another Swiper!</p>
        </div>
        </div>
        <div class="swiper-slide swiper-slide-duplicate" style="width: 513px; height: 560px;"> <img src="images/slider1-1.png"> </div>
        </div>
        </div>
        <div class="pagination"><span class="swiper-pagination-switch"></span><span class="swiper-pagination-switch"></span><span class="swiper-pagination-switch swiper-visible-switch swiper-active-switch"></span></div>
        </div>
        <!-- Initialize Swiper -->
        <script>
        var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationClickable: true,
        nextButton: '.swiper-button-next',
        prevButton: '.swiper-button-prev',
        spaceBetween: 0
        });
        </script>   

        This is the link to Swiper:
        http://idangero.us/swiper/#.WM4Hd_krIdU

        I also added in at the footer:
        <script src="js/swiper.js"></script>        
        <script src="js/swiper.min.js"></script>        
        <script src="js/swiper.jquery.js"></script>     
        <script src="js/swiper.jquery.min.js"></script>                 

you should develop your html according to the following template: 您应该根据以下模板开发html:

<!-- Slider main container -->
<div class="swiper-container">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
    <!-- Slides -->
    <div class="swiper-slide">Slide 1</div>
    <div class="swiper-slide">Slide 2</div>
    <div class="swiper-slide">Slide 3</div>
    ...
</div>
<!-- If we need pagination -->
<div class="swiper-pagination"></div>

<!-- If we need navigation buttons -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>

<!-- If we need scrollbar -->
<div class="swiper-scrollbar"></div>
</div>

load the minificated version (.min.js) OR the not minified (.js) 加载minificated版本(.min.js) 不精缩(.js文件)

include the swiper initialization script in the very end of body (right before closing tag) 在主体的末尾(紧接在结束标记之前)包含swiper初始化脚本

you can read the docs here : http://idangero.us/swiper/get-started/#.WNsOA98xA8o 您可以在此处阅读文档: http : //idangero.us/swiper/get-started/#.WNsOA98xA8o

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM