簡體   English   中英

iOS Spinning Wheel HTML5

[英]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);
        }
    },

您可以嘗試使用drag事件,但它們不受支持。 看看這個MDN文章這一個對事件的更多解釋。 您也可以嘗試使用jQuery,例如此插件 祝好運!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM