Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sliding left to right transition in jQuery Mobile

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?

like image 201
uzay95 Avatar asked Aug 26 '11 13:08

uzay95


2 Answers

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 });
like image 124
Daniel Avatar answered Jan 03 '23 18:01

Daniel


function ChangePage(pageId,iPageIndex) {
    var forward = iCurrCardIndex < iPageIndex;
    iCurrCardIndex = iPageIndex;

    $.mobile.changePage("#" + pageId, "slide", !forward, true);
}
like image 41
uzay95 Avatar answered Jan 03 '23 18:01

uzay95