SwipeView icon indicating copy to clipboard operation
SwipeView copied to clipboard

make on touch offset available

Open nicam opened this issue 13 years ago • 0 comments

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

nicam avatar Oct 08 '12 12:10 nicam