jgesture 在phonegap 中不起作用
我已经包含了 jgesture.min.js 但滑动功能不起作用,谁能告诉我如何解决问题
<script type="text/javascript" charset="utf-8" src="jquery.mobile/jgestures.min.js"></script>
this.container.bind("swiperight", function(event, body) {
alert("you swiped!");
});
I have included jgesture.min.js but swipe functon is not working can aybody tell how to solve problem
<script type="text/javascript" charset="utf-8" src="jquery.mobile/jgestures.min.js"></script>
this.container.bind("swiperight", function(event, body) {
alert("you swiped!");
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是插件设计的问题。
仅当滑动在 Y 轴上零移动时,swiperight 才会触发。
请参阅:只有 swipeone 可以与 jGestures 配合使用
It's a problem with the design of the plugin.
swiperight will only fire if the swipe has zero movement on the Y axis.
Please see: Only swipeone is working with jGestures
诀窍是:
您必须将其绑定到两个事件。仅向右滑动是行不通的。我花了 3 个小时才弄清楚:D
最好,
里科
The trick is:
You have to bind it to both events. only swiperight won't work. took me 3 hrs to figure that out :D
Best,
Rico