Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhoneGap - Android - swipe navigation in phonegap

I'm making an phonegap app for the android platform. In this app i want swipe navigation within multiple html pages. Please tell me how i can do this. Either it is done in single html page or i've to create multiple html page for this swipe navigation.

Thanks In Advance. preet

like image 219
Preet_Android Avatar asked May 22 '12 11:05

Preet_Android


1 Answers

If you are using jquery mobile then it is easy to do that because jquery support swipe,swipeleft and swiperight touch event.

swipe

A swipe event, triggered when the user swipes either vertically (20 or fewer pixels) or horizontally (30 or more pixels)

swipeleft

A left-directed swipe, triggered when the user swipes to the left 30 or more pixels

swiperight

A right-directed swipe, triggered when the user swipes to the right 30 or more pixels

use this:

<script>
$("ul").delegate("li", "swipe", function() {
 // The user has swiped to the right on a list view item. Show an edit menu.
$(this).find(".menu-edit").show();
})
</script>
like image 63
Jitendra Avatar answered Oct 31 '22 01:10

Jitendra