是否有用于模拟触摸事件的附加组件或扩展程序?

Sim*_*lGy 7 javascript-events touch

为了开发和调试移动和平板电脑应用程序,我希望能够让我的鼠标模拟touchstart,touchmove和touchend.

我发现了两种可能性:

Phantom Limb http://www.vodori.com/blog/phantom-limb.html (似乎不起作用)

ChromeTouch https://chrome.google.com/webstore/detail/ncegfehgjifmmpnjaihnjpbpddjjebme (滚动页面,但不触发触摸事件)

有没有人知道会在桌面webkit浏览器中触发触摸事件的插件?

Sim*_*lGy 2

我发现执行 touchmove 的唯一方法是执行如下手动编码的操作:

(function(){

var isDown = false
,   dragging
;

$('body').bind('mousedown', function(){ isDown = true; });
$('body').bind('mousemove', function(){ if(isDown) { dragging(); } });    
$('body').bind('touchmove', function(){ dragging(); });
$('body').bind('mouseup', function(){ isDown = false; });

dragging = function () {
    console.log('content being drug');
}

})();
Run Code Online (Sandbox Code Playgroud)