How do you prevent lags in touchmove event in javascript ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do you prevent lags in touchmove event in javascript ?

21st Aug 2021, 7:35 AM
Parth Shendge
3 Answers
+ 3
if(e.cancelable){e.preventDefault()} Put this code in your touchmove function
21st Aug 2021, 7:38 AM
SAN
SAN - avatar
+ 2
By setting touch-action for that element to none . It will remove the browser native touch events that comes into play when you touch the screen .
21st Aug 2021, 7:39 AM
Abhay
Abhay - avatar
0
Thank you !!!
21st Aug 2021, 7:53 AM
Parth Shendge