How to achieve a smooth drag effect in iOS?
I am developing a drag effect in a mobile project.
I found that when I started dragging an element in iOS, it did not move smoothly, there would be some jitters, the slower the dragging speed of the finger, the more obvious it would be. But there is no such problem in my Android device.
I wrote a demo, and found that there may be two reasons:
- As the drag speed becomes slower, the interval between touchmove events will be longer;
- The clientX/clientY of the touch point in TouchEvent are integers.
I want to ask, is there any way to make the drag effect smooth in iOS?
Below is my demo page:
https://cdpn.io/BiosSun/debug/VwKXQdd/VGrWNGQRBnYM (Open it in a mobile browser)
and the screen recording of the demo:
iOS
Android
Aucun commentaire:
Enregistrer un commentaire