Left to right shift in jQuery Mobile

I add page runtime when swipeleft happens. But when swiperight happened, I can’t return to the previous page that I created from sliding from left to right .

I added data-direction="reverse" pages to the pages, but did not create an effect from left to right.

Is there any way to do this?

+4
source share
5 answers
 function ChangePage(pageId,iPageIndex) { var forward = iCurrCardIndex < iPageIndex; iCurrCardIndex = iPageIndex; $.mobile.changePage("#" + pageId, "slide", !forward, true); } 
+3
source

It might be easier to use JQM:

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

as well as in js like:

 $.mobile.changePage("page.html", { transition: 'slide', reverse: true }); 
+11
source

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 the reverse conversion .html page.

+1
source

Using data-rel = "back", jQuery Mobile will simulate a back button, see "Backlink" here: http://jquerymobile.com/demos/1.0b1/#/demos/1.0b1/docs/pages/docs- pages.html

0
source
 <a href="nextPage.html" data-transition="reverse slide">Next page</a> 
0
source

Source: https://habr.com/ru/post/1369161/


All Articles