html5是否在手机上支持触摸? [英] Does html5 support touch on mobile phones?

查看:82
本文介绍了html5是否在手机上支持触摸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道html5是否在本机移动设备上支持触摸功能?因此,我们不必制作适用于iOS/Android/WP7的本机应用程序,而可以制作可在移动浏览器中加载的html5页面.

I was wondering if html5 is supporting touch functionality on a mobile device native? So we don't have to make an native app for iOS/Android/WP7 but can make an html5 page which loads in the mobile browser.

编辑

我的意思是浏览器中原生支持touch的JavaScript,因此您可以使用html5中的touch来做自己的事.

I mean the JavaScript support for touch native in the browser so you can do you own thing with the touch in html5.

推荐答案

取决于触摸事件的类型.对于您的标准浏览器,单击/鼠标事件由浏览器模拟.正如Halst所述,只需将您的可点击元素放大到足以在移动环境中工作即可.

Depends on the type of touch event. For your standard browser click/mouse events these are emulated by the browser. As mentioned by Halst, just make your clickable elements big enough to work in a mobile environment.

如果您想使用多点触控/手势,它会变得更加有趣.

If you want to use multitouch/gestures, it gets a little more interesting.

Webkit提供了touchstart, touchmove, touchend, touchcancel.对于单点触摸事件,IOS Safari和Android Webkit中的支持应相同.您可以自己滚动或使用类似 jqTouch 的库.

Webkit provides touchstart, touchmove, touchend, touchcancel. For single touch events support should be the same in both IOS Safari and Android Webkit. You could roll your own or use a library like jqTouch.

您可以阅读有关 IOS Safari如何处理触摸事件的更多信息. Android的事件似乎没有得到很好的记录,但是您可以在 quirksmode触摸支持上阅读更多内容.

You can read more on how IOS Safari handles touch events. Events for Android don't seem to be as well documented, but you can read more on quirksmode touch support.

这篇关于html5是否在手机上支持触摸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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