firefox和ie11中的Multi-Touch支持

时间:2016-07-01 11:51:36

标签: javascript firefox touch internet-explorer-11 multi-touch

我发现这个小提琴在我的浏览器中测试触控支持。 http://jsfiddle.net/J3TV8/97/

$(document).on("touchstart touchmove touchend touchcancel", function(ev) {
        $.each(ev.originalEvent.touches, function (i, t) { logtouch(ev.type + "-touches", t); });
        $.each(ev.originalEvent.changedTouches, function (i, t) { logtouch(ev.type + "-changed", t); });
        $.each(ev.originalEvent.targetTouches, function (i, t) { logtouch(ev.type + "-target", t); });
    });

我已删除上面链接中的mousemove,mouseclick,mousedown和mouseup事件,因此我可以测试触摸事件而不会受到其他事件的干扰

以上小提琴显示chrome中的一些文本但在Mozilla firefox和IE11中没有任何效果。

触摸支持的MDN链接:https://developer.mozilla.org/en-US/docs/Web/API/Touch_events

我也尝试过上面的MDN链接,但是没有触摸事件触发的痕迹

当我检查caniuse.com http://caniuse.com/#feat=touch时,支持表会显示带有标志的红色的Firefox。但是MDN链接没有提到任何内容。

有没有办法在firefox和ie11中识别多点触控? 。因为我正在为我的小部件添加捏合支持。我不确定如何识别这些浏览器中的多点触控。

修改 Firefox版本为47.0.1

1 个答案:

答案 0 :(得分:1)

IE11 支持pointer eventsPointer events处理所有类型的输入(触摸,鼠标,笔等)。

Firefox 尚未正式支持多点触控(在撰写此答案时)。但我们可以使用他们的夜间构建来测试触摸交互。默认情况下,Pointer Eventstouch events会在每晚禁用。我们应该通过about:config页面

启用它们
  

注意:使用about:config更改设置可能会使保修失效   这样做需要您自担风险