我将 Seadragon Ajax 与 jQuery 触摸事件侦听器一起使用。
容器绑定了 touchstart、touchmove 和 touchend,这里是 touch start:
.bind('touchstart MSPointerDown', function(e){
var p = coord(e.originalEvent);
p.start = true;
p.scale = 1;
if(e.originalEvent.pointerType === 4) return;
else if(e.originalEvent.pointerType !== undefined) e.originalEvent.preventMouseEvent();
$(this).data(p);
e.preventDefault();
e.stopPropagation();
})
在 seadragon 视图中生成了一些按钮。由于其容器 div 上的 touchstart,这些按钮不会在平板电脑上触发。它与鼠标一起工作正常。
new Seadragon.Button("Click to go", "", "", "", "", null, moveFunction, null, null, null );
我需要在 touchstart 功能中的所有内容之前检查触摸是否在按钮上,但真的不确定如何。