扫码关注官方订阅号
我想做的一个效果就是,一个p跟随手指移动。如果用move.pageX-start.pageX得到是总距离,
ringa_lee
简单写下结构,如果没理解错你的意思。
var start; start回调函数(){ start = touchStart时的坐标 } move回调函数(){ move = touchMove时的坐标 移动距离 = move - start //把初始位置变为现在的位置 start = move }
touchstart、touchmove、touchend
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
简单写下结构,如果没理解错你的意思。
touchstart、touchmove、touchend