Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make on touch offset available #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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