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.

上一篇:javascript-查找Phonegap使用的WebView?


下一篇:javascript-启动应用程序时启动屏幕