最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to stop swiping at last slide? - Stack Overflow

programmeradmin2浏览0评论

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. I can't figure out how to stop the swiping at the last slide or div. Anyway suggestion is much appreciated. I'm using the default swipe.

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. I can't figure out how to stop the swiping at the last slide or div. Anyway suggestion is much appreciated. I'm using the default swipe.

Share Improve this question asked Dec 2, 2013 at 23:58 2myCharlie2myCharlie 1,9475 gold badges26 silver badges40 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

In the API options section, it says that the default for looping is false...but have you tried explicitly setting it to false?

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

It looks like in their "default" example they are setting loop to 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.

Via: 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. 
发布评论

评论列表(0)

  1. 暂无评论