Skip to content

Conversation

@nicam
Copy link

@nicam nicam commented Oct 8, 2012

We implemented a feature that once you scroll down, the boxes left and right were moved down also with margin top. This made it possible to swipe left or right on a downscrolled page. You then were on top of the page you swiped to. Once you scroll again I have to reset the margin and scroll to 0,0 so you don't see the huge margin on top of the Container. This caused the problem that you couldn't swipe anymore for the first touchstart event.

The reason for this is that once I move the container, the difference between the startPoint and the currentPoint of the event is so big that the direction detection is already triggered. To prevent that I implemented an offset which is used once after it's set.

Now you can just call

swipeView.updateTouchOffset(0, window.pageYOffset);

to make the update the event coordinates for the next swipe

Ping me if you have any questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant