MeltingDog
MeltingDog

Reputation: 15404

JQuery Mobile: data-direction="reverse" not emulating initial transition

I have a back button in my header that looks like:

<a href="index.html" data-role="button" data-direction="reverse"
data-icon="arrow-l" data-iconpos="left">Back</a>

The transition to get to this page is slide and, according to the documentation, adding data-direction="reverse" to my back button should 'reverse' the transition that got me to that page, ie: the previous page should slide back. However, this seems to be stuck just on the default fade transition. Is there something I have done wrong in setting this button up? Should I have a different kind of href?

Upvotes: 2

Views: 7001

Answers (2)

Guilherme Rodrigues
Guilherme Rodrigues

Reputation: 21

What you can also do is declare the transition, so the reverse will work

<a href="index.htm" data-role="button" data-direction="reverse" data-transition="slide">Cancel</a>

In my case, this link is 2 pages after, so data-rel="back" was not what I was looking for

Upvotes: 2

Aaron
Aaron

Reputation: 1083

Try adding this:

data-rel="back"

<a href="/" data-icon="back" data-rel="back" data-direction="reverse">Back</a>

Also I think in order for "reverse" to work you must reference the exact previous URL/page. So if your page1 is "/" then you went to page2 and on page2 you have href="index.html" it won't work.

Upvotes: 5

Related Questions