R
R
Roman2018-12-02 03:21:55
JavaScript
Roman, 2018-12-02 03:21:55

Zalipalovo!!! how to add a smooth reaction to moving your finger across the screen of a mobile phone?

As part of the study of JS, we wrote with the child this screensaver ̶l̶ya̶ ̶m̶e̶d̶i̶t̶a̶ts̶i̶i̶ for sticking. Works great on PC, responds well to smooth mouse movements across the screen. On mobile phones, it only reacts to a one-time tap on the screen, which does not allow you to smoothly pull the center of the emitter of objects with you. I never wrote for mobile phones, I don’t have any experience with a touchscreen at all, googling didn’t help either, apparently I’m not asking correctly :)
Actually, the question is how to make the browser on mobile phones respond to moving a finger across the screen by analogy with moving a mouse on a PC? PS: corrected the links. Now always available.
5c03258f2c120620950588.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
barkalov, 2018-12-02
@lastuniverse

Use the touchmove event instead of mousemove.
Just keep in mind that this event is a little more complicated than a mouse event - after all, there can be several touches (fingers) at the same time, you need to process it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question