- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在开发一个将在 iOS 设备和台式机(无触摸)上使用的网络应用程序。我们正在使用 Bootstrap 使网站尽可能响应。
我们想要整合 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
事件,但它们并没有得到很好的支持。查看this MDN article和 this one对事件有更多解释。您也可以尝试将 jQuery 与例如 this plugin 一起使用.祝你好运!
关于javascript - iOS 纺车 HTML5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24078918/
我遇到了一个大问题,我的一些用户出现了奇怪的崩溃。在启动我的应用程序时,在启动屏幕之前或之后,他们会看到一个带有旋转轮的黑屏。之后设备被锁定,应用程序关闭。 除了 Xcode 8.3 和 iOS 10
我正在开发一个将在 iOS 设备和台式机(无触摸)上使用的网络应用程序。我们正在使用 Bootstrap 使网站尽可能响应。 我们想要整合 iOS 中已知的纺车。我们将以不同的方式设计它,但不会改变其
找不到它的调用方式和弹出方式。 我的 CF 应用程序正在使用 Web 服务通过 Web 进行通信。想要向我的用户显示一些“繁忙的事件”对话框。 关于如何显示 WinMo 中的默认值有什么建议吗? 最佳
我正在用 Node.js 构建一个 Web 应用程序,并使用 Socket.IO 处理客户端和服务器端之间的数据传输。 我的 Web 应用程序的核心部分是内容提要。我的客户端 Javascript 为
我是一名优秀的程序员,十分优秀!