禁用ie11 W8.1触摸设备上的保持盒 [英] Disable Hold Box on ie11 W8.1 Touch Device

查看:165
本文介绍了禁用ie11 W8.1触摸设备上的保持盒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Windows触摸设备时,按住某个区域会出现一个扩展框,该框会扩展到大约2平方厘米.然后放开鼠标,将出现一个右键单击菜单.

When using my Windows Touch Device, holding down on an area results in a an expanding box appearing which extends to about two centimetres squared. Letting go will then result in the right click menu appearing.

问题是我想禁止显示框和菜单.

The problem is that I want to disable the box and the menu from appearing.

我设法阻止了上下文菜单的出现,但是我仍然留下这个框.我认为此框会干扰页面上的其他功能.

I have managed to prevent the context menu from appearing, but I am still left with the box. I believe the box is interfering with other functionality I have on the page.

任何帮助,不胜感激, 谢谢

Any help much appreciated, Thanks

更新

通过阅读以下内容(请参见上下文菜单部分):

From reading the following (see section context menus):

http://msdn. microsoft.com/en-us/library/ie/jj583807(v=vs.85).aspx

看来我要禁用保持视觉"框.

it appears that I am looking to disable the "hold visual" box.

更新

我试图拦截MSGestureHold事件以覆盖它,但似乎没有被捡起:

I have tried to intercept the MSGestureHold event in order to override it, but it does not seem be getting picked up:

      if (window.PointerEvent) {
          // elm.addEventListener("pointerdown", touchstart, false);
          elm.addEventListener("MSGestureHold", touchhold, false);
          alert('pointerdown');
      } else if (window.MSPointerEvent) {
          // elm.addEventListener("MSPointerDown", touchstart, false);
          alert('MSPointerDown');
      } else {
          //elm.addEventListener("mousedown", touchstart, false);
          alert('mousedown');
      }

我知道在ie11中,事件的MS部分已被删除(例如,上面的pointerdown),但是手势也不会被拾取.实际上,MSGestureHold似乎没有出现在ie11的指针事件更新页面...

I know that in ie11, the MS part of the events has been removed (eg pointerdown above), but gesturehold does not get picked up either. In fact, MSGestureHold does not appear to have been in listed in ie11's Pointer Event Updates page...

推荐答案

您要查找的事件是"MSHoldVisual"

The event you are looking for is "MSHoldVisual"

尝试一下:

window.addEventListener("MSHoldVisual", function(e) { e.preventDefault(); }, false);

http://msdn. microsoft.com/en-us/library/ie/jj583807(v=vs.85).aspx

这篇关于禁用ie11 W8.1触摸设备上的保持盒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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