You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a lot of mobile projects I have a hardcoded version of swipe to make this. I've decided to fork your repo and add the "partial" option. Check it out:
@arcxyz Nice Feature!
I create a PR from your repo, and will review it later. But there is a little bug: lets say there are 3 slides, starting at 1, when click next, 1 is moving faster than 2.
@arcxyz Great Job
But I found that if I change the ratio of each slide, like this: width = options.partial ? containerWidth*0.8 : containerWidth; element.style.width = (slides.length * width) + 'px'; partialPos = { hidden: containerWidth, prev: -containerWidth*0.7, middle: containerWidth*0.1, next: containerWidth*0.9 };
I clicked next and the next slide does not appear, and then I checked slide direction definition
var direction = Math.abs(index-to) / (index-to); // 1: backward, -1: forward
and I change if (options.partial) { if (direction === -1) {
to
if (options.partial) { if (natural_direction === -1) {
in function slide, the next slide shows up.
For a lot of mobile projects I have a hardcoded version of swipe to make this. I've decided to fork your repo and add the "partial" option. Check it out:
Demo: http://arcxyz.github.io/swipe/
Code: https://github.com/arcxyz/swipe
It only works with 3+ slides and probably only with continuous option.
The text was updated successfully, but these errors were encountered: