Reputation: 1047
I'm looking at TouchSwipe plugin - http://labs.rampinteractive.co.uk/touchSwipe/demos/ and I was wondering how can I call other HTML file on Swipe gesture?
So I have one div, where TouchSwipe works. On swipe left I would like browser to open one html file like hyperlink and on swipe right, the other one.
So the code is like this:
$("#swipe").swipe({
swipeLeft:function(event, direction, distance, duration, fingerCount) {
}
});
Thank you guys for advices and help!
Upvotes: 3
Views: 963
Reputation: 1762
i think this should do it, assuming you have id="swipe" in both 1.html, and 2.html.
// ------------
// 1.html.
// ------------
$("#swipe").bind("swipeleft",function(event) {
$("#div").load( "2.html");
});
// ------------
// 2.html.
// ------------
$("#swipe").bind("swiperight",function(event) {
$("#div").load( "1.html");
});
Upvotes: 1