简体   繁体   English

如何停止在最后一张幻灯片上滑动?

[英]How to stop swiping at last slide?

I feel bad that I have to ask for help in this forum but the site I downloaded the script from does not have any form of help. 我不得不在这个论坛上寻求帮助感到很难过,但是我从中下载脚本的网站没有任何形式的帮助。

Anyway, I'm using a swiping script from iDangerous Swiper . 无论如何,我正在使用iDangerous Swiper中的滑动脚本。 I can't figure out how to stop the swiping at the last slide or div. 我不知道如何在上一张幻灯片或div上停止滑动。 Anyway suggestion is much appreciated. 无论如何,建议是值得赞赏的。 I'm using the default swipe. 我正在使用默认滑动。

In the API options section , it says that the default for looping is false...but have you tried explicitly setting it to false? 在“ API选项”部分中 ,它说循环的默认值为false ...但是您是否尝试过将其默认设置为false?

var mySwiper = new Swiper('.swiper-container', { 
    speed:750,
    loop: false
})

It looks like in their "default" example they are setting loop to true: 看起来在他们的“默认”示例中,他们将循环设置为true:

var mySwiper = new Swiper('.swiper-container',{
    pagination: '.pagination',
    loop: true,
    grabCursor: true,
    paginationClickable: true
})

If you simply remove, the loop property it may fix your issue. 如果仅删除循环属性,则可能会解决您的问题。

From the documentation for iDangerous Swiper , it looks like you should add the noSwipingClass css class to the div for the last slide . iDangerous Swiper文档中,您似乎应该将noSwipingClass css类添加到最后一张幻灯片div中。

Via: http://www.idangero.us/sliders/swiper/api.php 通过: http : //www.idangero.us/sliders/swiper/api.php

noSwipingClass  
string  
'swiper-no-swiping' 
'stop-swiping'   
CSS class of html element that will be used to prevent swiping when "noSwiping" parameter is set to true. 

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

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