Pointermove不触发IE浏览器 [英] Pointermove does not fire for touch on IE

查看:256
本文介绍了Pointermove不触发IE浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在IE11上听 pointermove 事件,但似乎 pointermove 只会触发鼠标(和可能是笔),但不是当你用手指时。

I want to listen to pointermove event on IE11, but it seems that pointermove only fires for mouse (and possibly pen), but not when you are using your finger.

http://jsfiddle.net/qq2hjL2g/

实际上,规范说它会为笔/鼠标触发,所以这可能不是一个真正的错误。

Actually, the specification says that it fires for pens/mice, so this may not be really a bug.

但是,有没有办法在IE上听touchmove进行触摸?必须有,但我很惊讶地看到 pointermove 根本没有开火。

But, is there any way to listen to pointermove on IE for touch? There must be, but I was very surprised to see pointermove not firing at all.

编辑: 我发现如果我在div上放置CSS touch-action:none ,则会触发pointermove事件。但为什么?我正在尝试找到与此相关的文档,但到目前为止我找不到任何文件。

I found that if I put CSS touch-action: none on the div, pointermove events fire. But why? I'm trying to find documents related to this, but I couldn't find any so far.

编辑:我认为 touch-action CSS指定浏览器处理哪些触摸操作。这意味着将 touch-action 设置为 none 告诉浏览器处理任何触摸事件,开发人员负责控制JavaScript事件的行为。这就是为什么我只有在拥有CSS时才能正常启动事件。 (有关详细信息,请参阅 MDN 。)

I learend that the touch-action CSS specifies which touch actions are handled by the browser. This means setting touch-action to none tells the browser to not handle any touch events, and the developer is responsible for controlling the behaviour throutgh JavaScript events. This is why I was getting the events fired properly only when I had the CSS. (See more at MDN.)

推荐答案

我也试图与IE11 touch接口。
我相信MSGesture用于触摸事件,因为在他们的文档中他们指的是手指

I'm also trying to interface with IE11 touch. I believe MSGesture is used for touch events because in their documentation they refer to "fingers"

http://msdn.microsoft.com/en-us/library/windows/apps/hh465856.aspx

http:/ /msdn.microsoft.com/en-US/library/ie/hh968249.aspx

我相信你感兴趣的手势是:
MSGestureStart - 触摸屏幕在此元素上的某个位置时触发。

I believe the gestures you are interested in are: MSGestureStart - "Triggered when the screen is touched on a location over this element."

MSGestureChange - 当与交互相关的手指位置在屏幕上移动时触发。

MSGestureChange - "Triggered when the finger positions associated with the interaction moves on the screen."

MSGestureEnd - 当从表面移除所有关联的联系人时会触发此事件

MSGestureEnd - "This event fires when all associated contacts are removed from the surface"

这篇关于Pointermove不触发IE浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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