0

This question is not to be confused with something like this which uses differences in scroll position to determine the scroll direction. A few years ago, I coded a project utilizing the wheel event's deltaY properties to determine the wheel direction without there being scrollbars on the page. I wrote an answer available here documenting how that works.

My question is: how can I replicate this effect on a mobile device? How can I determine the direction of a touchmove on a mobile device without scroll bars or scroll being fired? This detection cannot depend on position because the project's design is specifically made to avoid using scroll bars. MDN's touchevent documentation has no mention of a property like delta found in the well supported wheel event in desktop browsers.

www139
  • 4,960
  • 3
  • 31
  • 56
  • 1
    You could use `touchstart` and `touchend` and detect how the point has changed. Does this question by some chance contain an answer to your question? https://stackoverflow.com/questions/2264072/detect-a-finger-swipe-through-javascript-on-the-iphone-and-android – Yeldar Kurmangaliyev Feb 25 '19 at 18:58
  • Position information in touch events has nothing to do with scrollbars. – Pointy Feb 25 '19 at 18:59
  • @Pointy Yes, I mentioned it only because a lot of the existing answers for this issue are in situations where the scrollbars are present and a change in scroll position is used to find the direction of the swipe. – www139 Feb 25 '19 at 19:01
  • @YeldarKurmangaliyev that's a great idea! I'll give it a shot. – www139 Feb 25 '19 at 19:02

0 Answers0