Swiper: Disable swipe, disable navigation

Created on 26 Jul 2016  路  8Comments  路  Source: nolimits4web/swiper

Hello,

I try something unusual with Swiper : I want to disable swiping/sliding touch move and only change slide programmatically.
I disable swiping move :
vm.sliderOptions = { loop : false, effect : 'flip', speed : 200, initialSlide : 0, pagination : false, simulateTouch : false, allowSwipeToNext: false, allowSwipeToPrev: false };

And I can't slide to another slide programmatically : vm.slider.slidePrev();
I need to unlock swipe to do that :
vm.slider.unlockSwipeToPrev(); vm.slider.slidePrev(); vm.slider.lockSwipeToPrev();

Do I miss something ?

Thanks

Most helpful comment

IMO it would be a useful feature to disable manual swiping while allowing programatic swiping rather than unlocking, sliding, and then locking again.

All 8 comments

Yes, if you lock swipes it won't be moved, so you doing things right

IMO it would be a useful feature to disable manual swiping while allowing programatic swiping rather than unlocking, sliding, and then locking again.

Or you can simply create a transparent overlay over the swiper. Works like a charm 馃憣

@glemiere I wonder how you are doing that: it doesn't work at all for me... Even with an overlay with pointer-events: none

I have the swiper and the overlay inside a div, they鈥檙e both in position absolute, and my overlay has a greater z-index than my swiper ;-)

Same problem here, but with more responsivity, thus resizing and stuff, and lazy loading of images. Makes it difficult to retrieve height and width for the overlay. Would be nice, when there would be any functionality like initial rendering and then disabling the whole thing (i'm using coverflowEffect, without auto swiping)

My overlay is totally responsive, using % and calc() in css should be enough ;)

btw : @AStaege I'm doing lazy loading as well behind my overlay, I've noticed that Safari has a memory leak issue while loading pictures on the latest version, are you able to confirm ?

Was this page helpful?
0 / 5 - 0 ratings