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?
13 hours ago in Node-js by Nidhi
• 14,200 points
15 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 6 hours ago by anonymous

Related Questions In Node-js

0 votes
0 answers

How to implement a search bar within the navigation bar in Bootstrap 3?

With the help of code can you ...READ MORE

6 days ago in Node-js by Ashutosh
• 25,410 points
33 views
0 votes
0 answers

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

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

13 hours ago in Node-js by Ashutosh
• 25,410 points
9 views
0 votes
1 answer

How to setup route for websocket server in express?

Hello @kartik, You'll want to use the path option: var wss ...READ MORE

answered Oct 16, 2020 in Node-js by Niroj
• 82,840 points
5,711 views
0 votes
1 answer

How to use pino-transport in nodejs for logs?

Ensure that you have a recent version ...READ MORE

answered Jun 9, 2022 in Node-js by Neha
• 9,020 points
5,714 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

13 hours ago in Node-js by Nidhi
• 14,200 points
11 views
0 votes
1 answer

How to disable weekends in jQuery UI Datepicker selection?

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

answered 6 hours ago in Node-js by anonymous
15 views
0 votes
0 answers

How to implement a time picker alongside jQuery UI Datepicker?

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

13 hours ago in Node-js by Nidhi
• 14,200 points
12 views
0 votes
1 answer

How to highlight specific dates with custom styles in jQuery UI Datepicker?

Here's how to highlight specific dates with ...READ MORE

answered 6 hours ago in Node-js by anonymous
14 views
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 6 hours ago in Node-js by anonymous
16 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
88 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