lzbk

onmousedown
--->ontuchstart

onmousemove
--->ontouchmove

onmouseup
--->ontouchend

ontuchstart & ontouchmove & ontouchend 必须通过事件绑定的形式添加;

尽快的把页面呈现给用户:
window.onload ----> 不靠谱;
DOMContentLoaded

clientX ---> ev.targetTouches,是一个列表,使用的时候需要加下标使用;
pageX:算上了scrollL; 在PC端不兼容;
pageY:算上了scrollTop; 在PC端不兼容;

会闪烁:开启硬件加速;
translate3d();

会卡顿:
ev.preventDefault();

只能拖动一次:
事件加给document;

手指抬起[ontouchend]的距离:ev.changedTouches[0].pageX;

 

分类:

技术点:

相关文章:

  • 2022-01-19
  • 2022-12-23
  • 2021-08-30
  • 2021-11-27
  • 2021-04-29
  • 2021-07-20
  • 2022-12-23
  • 2021-12-02
猜你喜欢
  • 2021-09-20
  • 2022-03-02
  • 2021-12-09
  • 2021-07-25
  • 2021-09-30
  • 2022-12-23
  • 2021-06-29
相关资源
相似解决方案