gpt4 book ai didi

javascript - iOS 纺车 HTML5

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:39:12 26 4
gpt4 key购买 nike

我正在开发一个将在 iOS 设备和台式机(无触摸)上使用的网络应用程序。我们正在使用 Bootstrap 使网站尽可能响应。

我们想要整合 iOS 中已知的纺车。我们将以不同的方式设计它,但不会改变其功能。

Spinning Wheel

经过一番搜索,我发现了这个网站: 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 事件,但它们并没有得到很好的支持。查看this MDN articlethis one对事件有更多解释。您也可以尝试将 jQuery 与例如 this plugin 一起使用.祝你好运!

关于javascript - iOS 纺车 HTML5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24078918/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com