Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var lastY = null;
- var currentY = null;
- jqInboxItem.on("touchstart", function(event) {
- lastY = event.originalEvent.touches[0].pageY;
- currentY = event.originalEvent.touches[0].pageY;
- });
- jqInboxItem.on("touchmove", function(event) {
- currentY = event.originalEvent.touches[0].pageY;
- var adjustment = lastY-currentY;
- // only make an adjustment if cursor position changes vertically by more than 3 pixels
- if (Math.abs(lastY-currentY) > 3) {
- window.scrollBy(0,adjustment);
- lastY = currentY + adjustment;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement