How to implement swipe gestures for navigation in jQuery Mobile

0 votes
Can you tell me How to implement swipe gestures for navigation in jQuery Mobile?
Apr 7 in Node-js by Nidhi
• 15,360 points
50 views

1 answer to this question.

0 votes

To enable swipe gestures for page navigation in jQuery Mobile, use the swipeleft and swiperight events. Below is the exact implementation:

Basic Swipe Navigation

$(document).on("pagecreate", function() {

    $(document).on("swipeleft", ".ui-page", function(event) {

        var nextpage = $(this).jqmData("next");

        if (nextpage) {

            $.mobile.changePage(nextpage, { transition: "slide" });

        }

    });

    

    $(document).on("swiperight", ".ui-page", function(event) {

        var prevpage = $(this).jqmData("prev");

        if (prevpage) {

            $.mobile.changePage(prevpage, { transition: "slide", reverse: true });

        }

    });

});

answered Apr 7 by anonymous

Related Questions In Node-js

0 votes
0 answers
0 votes
0 answers

How to customize icons for expand/collapse in jQuery Accordion headers?

Can you tell me How to customize ...READ MORE

Apr 7 in Node-js by Ashutosh
• 27,010 points
31 views
0 votes
1 answer

How to prevent default scrolling behavior during touch events in jQuery Mobile?

To prevent the default scrolling behavior during ...READ MORE

answered 6 days ago in Node-js by anonymous
42 views
0 votes
1 answer

How to handle the swiperight event to trigger custom actions in jQuery Mobile?

To handle the swiperight event and trigger ...READ MORE

answered 6 days ago in Node-js by anonymous
38 views
0 votes
0 answers

How to create a single-page navigation system using jQuery Mobile?

Can you tell me How to create ...READ MORE

Apr 7 in Node-js by Nidhi
• 15,360 points
59 views
0 votes
1 answer

How to disable weekends in jQuery UI Datepicker selection?

To disable weekends (Saturdays and Sundays) in ...READ MORE

answered Apr 7 in Node-js by anonymous
49 views
0 votes
0 answers

How to implement a time picker alongside jQuery UI Datepicker?

Can you explian to me How to ...READ MORE

Apr 7 in Node-js by Nidhi
• 15,360 points
38 views
0 votes
1 answer
0 votes
1 answer

How to implement grid layouts with nested columns in jQuery Mobile?

The most effective way to implement nested ...READ MORE

answered Apr 7 in Node-js by anonymous
55 views
0 votes
1 answer

How to implement action creators in Redux for async actions?

To implement action creators in Redux for ...READ MORE

answered Mar 18 in Node-js by Anvi
97 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP