Question

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!

Was it helpful?

Solution

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");
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top