微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javascript-在phonegap android中滑动手势

嗨,大家好,我是javascript和html的新手.能否请您向我建议如何在phonegap android中实现轻扫?感谢您的宝贵建议.

解决方法:

如果您使用的是jQuery mobile,则可以使用内置的事件滑动.

Documentation

例如.:

$("#myContainer").on("swipe", function(event) {
    alert("I got swiped!");
});

如果您使用的是jQuery UI,请查看jQuery UI Touch Punch.

jQuery UI Touch Punch is a small hack that enables the use of touch events on sites using the jQuery UI user interface library.

Hammer.js在这里也值得一提.它可以在原始JavaScript以及jQuery插件中使用.

Hammer supports Tap, DoubleTap, Swipe, Drag, Pinch, and Rotate gestures. Each gesture triggers useful events and eventData.

如果您不想使用插件,请查看following.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐