扫码关注官方订阅号
就是监听了touchmove的位置让元素移动,但有些卡顿,要很慢滑动才会有效果?
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
1、用transform:translateY移动,避免直接操作top、margin-top等导致页面频繁reflow 2、touchmove的handler里面,需要执行preventDefault(),屏蔽掉原生滚动
用transform3d更好可以开启硬件加速
你的需求我做過類似的,自己實現 elastic scrolling,用的 touchmove 和 transform3d。
毫無違和感。
https://bumfo.github.io/overflow.html
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
1、用transform:translateY移动,避免直接操作top、margin-top等导致页面频繁reflow
2、touchmove的handler里面,需要执行preventDefault(),屏蔽掉原生滚动
用transform3d更好可以开启硬件加速
你的需求我做過類似的,自己實現 elastic scrolling,用的 touchmove 和 transform3d。
毫無違和感。
https://bumfo.github.io/overflow.html