Get next page in jQuery Mobile?

328
November 28, 2016, at 7:58 PM

How do I get the next page object in jQuery Mobile?

Have tried this:

var nextpage = $.mobile.activePage.next('[data-role="page"]');

and this:

var nextpage = $.mobile.pageContainer.pagecontainer('getActivePage').next('[data-role="page"]');

Non of them works. Have of course tried to read documentation but can't figure out how to do.

I'm having jQuery Mobile version 1.4.5.

Answer 1

Try:

$(":mobile-pagecontainer").pagecontainer( "getActivePage" ).next('[data-role="page"]').prop("id");

DEMO

API Docs: http://api.jquerymobile.com/pagecontainer/#method-getActivePage

READ ALSO
Why is my ajax call only handling part of the data i am sending to my server?

Why is my ajax call only handling part of the data i am sending to my server?

I am trying to use Ajax to upvote a postIin addition to sending upvote data, I want to send the ID of the post so that I can eventually use findOneAndModify from mongoose to target that specific post and upvote by 1

240
Adding and Removing class on clicks (in wordpress loop)

Adding and Removing class on clicks (in wordpress loop)

So I have a wordpress loop to show certain postsEach posts has a modal that I'll show the in and each modal is triggered by the

346
Let a modal pop-up from a side nav

Let a modal pop-up from a side nav

I want a modal to pop-up from a side-nav, so that the user can change his passwordBut the modal doesn't pop-up

242
What technologies for a 2D house plan?

What technologies for a 2D house plan?

I would like to know what technologies can i use to implement in my website a software which can draw 2d house plan ?

226