Javascript iOS纺车HTML5
我正在开发一个webapp,它将在iOS设备和台式机上使用(无需触摸)。 我们正在使用引导程序使站点尽可能响应 我们想让iOS中的纺车停止运转。 我们将采用不同的样式,但不包括功能 经过一番搜索,我发现了这个网站: 然而,这个脚本似乎只适用于支持触摸的设备。是否可以编辑脚本,使其也能在桌面上工作 我在脚本中找到了这个我可以在这里添加一个mouseClickHandler吗Javascript iOS纺车HTML5,javascript,ios,iphone,html,twitter-bootstrap,Javascript,Ios,Iphone,Html,Twitter Bootstrap,我正在开发一个webapp,它将在iOS设备和台式机上使用(无需触摸)。 我们正在使用引导程序使站点尽可能响应 我们想让iOS中的纺车停止运转。 我们将采用不同的样式,但不包括功能 经过一番搜索,我发现了这个网站: 然而,这个脚本似乎只适用于支持触摸的设备。是否可以编辑脚本,使其也能在桌面上工作 我在脚本中找到了这个我可以在这里添加一个mouseClickHandler吗 handleEvent: function (e) { console.log(e.type);
handleEvent: function (e) {
console.log(e.type);
if (e.type == 'touchstart') {
this.lockScreen(e);
if (e.currentTarget.id == 'sw-cancel' || e.currentTarget.id == 'sw-done') {
this.tapDown(e);
} else if (e.currentTarget.id == 'sw-frame') {
this.scrollStart(e);
}
} else if (e.type == 'touchmove') {
this.lockScreen(e);
if (e.currentTarget.id == 'sw-cancel' || e.currentTarget.id == 'sw-done') {
this.tapCancel(e);
} else if (e.currentTarget.id == 'sw-frame') {
this.scrollMove(e);
}
} else if (e.type == 'touchend') {
if (e.currentTarget.id == 'sw-cancel' || e.currentTarget.id == 'sw-done') {
this.tapUp(e);
} else if (e.currentTarget.id == 'sw-frame') {
this.scrollEnd(e);
}
} else if (e.type == 'webkitTransitionEnd') {
if (e.target.id == 'sw-wrapper') {
this.destroy();
} else {
this.backWithinBoundaries(e);
}
} else if (e.type == 'orientationchange') {
this.onOrientationChange(e);
} else if (e.type == 'scroll') {
this.onScroll(e);
}
},
您可以尝试使用
拖动
事件,但它们不受很好的支持。查看并了解更多有关事件的解释。例如,您也可以尝试使用jQuery。祝你好运