何时使用touchmove vs mousemove? [英] When to use touchmove vs mousemove?

查看:343
本文介绍了何时使用touchmove vs mousemove?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立了一个网络手机游戏,它在浏览器(PC /手机)上运行。

I build a web mobile game, it runs on browsers (PC/Mobile).

我是否需要使用touchmove?

Do I need to use the touchmove or not?

如何像mousemove事件一样运行touchmove事件?

How can I run the touchmove event like the mousemove event?

推荐答案

桌面和触摸你有以下等同:

For parity between desktop and touch you have the following equivalences:

mousedown === touchstart
mousemove === touchmove
mouseup === touchend

因此,如果你处理mousedown,mousemove和mouseup,那么你不需要触摸下处理相应的等效事件。相同的处理程序应该正在执行。

Thus if you handle mousedown, mousemove and mouseup then you don't need to handle the corresponding equivalent events under touch. The same handlers should be executing.

这篇关于何时使用touchmove vs mousemove?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆