sliding left to right transition in jQuery Mobile
Asked Answered
S

5

5

I'm adding pages run time when swipeleft is happened. But when swiperight happened I can't return the previous page that I'm created with sliding from left to right.

I have added the data-direction="reverse" to the pages but it didn't create left-to-right effect.

Is there any way to do this?

Sinister answered 26/8, 2011 at 13:46 Comment(0)
S
3
function ChangePage(pageId,iPageIndex) {
    var forward = iCurrCardIndex < iPageIndex;
    iCurrCardIndex = iPageIndex;

    $.mobile.changePage("#" + pageId, "slide", !forward, true);
}
Sinister answered 26/8, 2011 at 15:14 Comment(0)
M
12

A maybe easier way using JQM would be:

<a href="page.html" data-transition="slide" data-direction="reverse">Link Text</a> 

or also, within js as:

$.mobile.changePage("page.html", { transition: 'slide', reverse: true });
Money answered 8/4, 2013 at 15:30 Comment(0)
S
3
function ChangePage(pageId,iPageIndex) {
    var forward = iCurrCardIndex < iPageIndex;
    iCurrCardIndex = iPageIndex;

    $.mobile.changePage("#" + pageId, "slide", !forward, true);
}
Sinister answered 26/8, 2011 at 15:14 Comment(0)
G
1

data-direction="reverse" does not belong on the page, you add it to the link:

<a href="page.html" data-direction="reverse">Link Text</a> 

will send you to page.html with a reverse transition.

Goddamn answered 10/6, 2012 at 9:28 Comment(0)
G
0

By using data-rel="back" jQuery Mobile will mimic the back button, see "Back linking" here: http://jquerymobile.com/demos/1.0b1/#/demos/1.0b1/docs/pages/docs-pages.html

Glaucous answered 14/7, 2012 at 15:1 Comment(0)
M
0
<a href="nextPage.html" data-transition="reverse slide">Next page</a>
Mooncalf answered 20/2, 2013 at 12:32 Comment(1)
This does show a blank page between the current page and the page you want to go toIrremissible

© 2022 - 2024 — McMap. All rights reserved.