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

问题描述 投票:7回答:1

为了开发和调试移动和平板电脑应用程序,我希望鼠标能够模拟touchstarttouchmovetouchen d。

我发现了两种可能性:

幻肢http://www.vodori.com/blog/phantom-limb.html(似乎无效)

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

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

javascript mobile touch dom-events
1个回答
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');
}

})();
© www.soinside.com 2019 - 2024. All rights reserved.