S
S
sqr_behr2017-08-17 11:43:23
JavaScript
sqr_behr, 2017-08-17 11:43:23

How to attach touch gestures to custom slider without plugins?

I wrote a slider in native JS. But I ran into a problem with gestures on mobile devices. The solutions I found were based on the fact that it is necessary to turn off the standard behavior of the touchstart and touchmove events, and then write your own swipe to the X axis and, accordingly, scroll along the swipe in relation to the Y axis. Are there other solutions to this problem? Third-party libraries, please do not advise. My task is to understand the mechanics of gestures.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shemil, 2017-08-23
@Shemil

Pointer events
Pointer Events Polyfill
Lectures from SRI

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question