Will/Does IE10 Support Touch Events?

≡放荡痞女 提交于 2019-12-18 11:56:19

问题


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.


回答1:


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

  • The W3C has formed a Working Group based on Microsoft's Pointer model.
  • Hand.js: a polyfill for supporting pointer events on every browser



回答2:


It appears IE 10 doesn't support the 'touchstart' family of events used by iOS and other mobile browsers. IE 10 does however support multi-touch events using their own 'MSPointer' events. See http://msdn.microsoft.com/en-us/ie/hh272903#_DOMTouch for details and example sites like http://ie.microsoft.com/testdrive/Graphics/TouchEffects.



来源:https://stackoverflow.com/questions/6986490/will-does-ie10-support-touch-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!