Louis van Tonder
Louis van Tonder

Reputation: 3700

jquery mobile, call transition from event

To have JQM apply a transition on a link, we use the following:

<a href="index.html" data-transition="pop">I'll pop</a>

How do I call a transition form a custom event?

I use:

window.location.href = href; to navigate from my custom event.

I can't seem to find anything on the reference material, except for the markup.

Upvotes: 0

Views: 38

Answers (1)

Timothy Groote
Timothy Groote

Reputation: 8643

One way is to set up a default global transition

You can set up the default global transition like this:

$(document).bind("mobileinit", function(){
  //these are the jqm default values for these transition types by the way.
  $.mobile.defaultDialogTransition = "pop";
  $.mobile.defaultPageTransition = "fade";
});

if you're looking for custom transitions for a specific event, you could use this :

$.mobile.changePage("yourpage.html", {transition:"slide"});

rather than a plain HTML link, or a window.location=something;

Upvotes: 1

Related Questions