我正在查看 TouchSwipe 插件 - http://labs.rampinteractive.co.uk/touchSwipe/demos/我想知道如何在滑动手势上调用其他 HTML 文件?
所以我有一个 div,TouchSwipe 在其中工作。在向左滑动时,我希望浏览器打开一个 html 文件,如超链接,在向右滑动时,打开另一个。
所以代码是这样的:
$("#swipe").swipe({
swipeLeft:function(event, direction, distance, duration, fingerCount) {
}
});
谢谢大家的建议和帮助!
最佳答案
我认为应该这样做,假设您在 1.html 和 2.html 中都有 id="swipe"。
// ------------
// 1.html.
// ------------
$("#swipe").bind("swipeleft",function(event) {
$("#div").load( "2.html");
});
// ------------
// 2.html.
// ------------
$("#swipe").bind("swiperight",function(event) {
$("#div").load( "1.html");
});
关于jquery - 使用 TouchSwipe 插件在滑动手势上调用其他 HTML 文件(超链接),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16466950/