Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swipe between webpages for a webapp

I want to create a webapp (to avoid having to program individually for iPhone, Android, BB, etc) and am looking for a swipe effect. Is there an HTML5 or webkit code simply saying "swipe to next/previous page"? (I know it would be more detail code than that, but that's the gist of what I want)

like image 374
SnowboardBruin Avatar asked May 02 '12 14:05

SnowboardBruin


1 Answers

you can use div to swipe around but not entire page in web browser.i,e you can only load pages in a div after swipe affect and not move entire page itself.

works only in chrome,safari.

here is a code if u r using jquery mobile.

$('body').live('swipeleft swiperight',function(event){
    if (event.type == "swiperight") {
       alert("swipped right side");      
    }
    if (event.type == "swipeleft") {
        alert("swipped left side");
    }
    event.preventDefault();
}); 

refer more here swipe detection

like image 155
sree Avatar answered Sep 22 '22 09:09

sree