[英]iOS Spinning Wheel HTML5
我正在開發一個將在iOS設備和桌面上使用的webapp(沒有觸摸)。 我們使用引導程序使網站盡可能響應。
我們想要加入iOS中已知的紡車。 我們將以不同的方式設計它,但不是功能。
經過一番搜索,我發現了這個網站: http : //cubiq.org/spinning-wheel
但是,此腳本似乎只適用於支持觸摸的設備。 是否可以編輯腳本以便它也適用於桌面?
我在腳本中發現這個可以在這里添加一個mouseClickHandler嗎?
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);
}
},
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.