IE10是否支持触摸事件? [英] Will/Does IE10 Support Touch Events?

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

问题描述

我正在看一个使用触摸屏来定位Internet Explorer 10的项目。我目前没有触摸屏方便,但需要知道Internet Explorer 10是否支持DOM触摸事件。

解决方案

p> 更新:触摸事件是 在开发中 在Internet Explorer中。



虽然IE10不支持 touchstart touchend 类型的事件,它将支持一个可以说是由指针组成的优秀模型。这些通用指针捕获笔,鼠标和手指的输入。在 触摸2011年9月的IE10和Metro样式应用程序的输入。



您应该可以使用较老的触摸模式,使用MSPointer模型,只需轻轻点击功能检测和智能脚本:

  var elm = document.getElementById(#foo),
evt = window.navigator.msPointerEnabled? MSPointerDown:touchstart;

elm.addEventListener(evt,handler,false);

更多关于指针和手势的事件可以在这里找到: http://msdn.microsoft.com/en-US/library/ie/hh673557.aspx



重要发展




I'm looking at doing a project that would target Internet Explorer 10 using a touch screen. I don't currently have a touch screen handy, but need to know if Internet Explorer 10 does or will support DOM touch events.

解决方案

Update: Touch Events are in development in Internet Explorer.

While IE10 will not support the touchstart and touchend type of events, it will support an arguably superior model consisting of Pointers. These generic pointers capture input from pens, mice, and fingers. A great primer was given in the post Touch Input for IE10 and Metro style Apps, dated Sept, 2011.

You should be able to get the older touch model to work well with the MSPointer model with just abit of feature-detection and clever-scripting:

var elm = document.getElementById("#foo"),
    evt = window.navigator.msPointerEnabled ? "MSPointerDown" : "touchstart";

elm.addEventListener(evt, handler, false);

More on Pointer and Gesture events can be found here: http://msdn.microsoft.com/en-US/library/ie/hh673557.aspx

Important Developments

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

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