cubiq/SwipeView — pull request #36 by nicam (2012-10-08 12:26:05+00:00)
Title: make on touch offset available

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