Luka
Luka

Reputation: 3089

How to set same page transition for every navigation in jQuery mobile?

I use Pagecontainer widget for navigation. There is an option allowSamePageTransition, when set to true it does exactly what its name says. It can be used like so:

$.mobile.pageContainer.pagecontainer('change', '#myPage', {allowSamePageTransition: true});

I would like not to specify this option every time, rather set this option to true for all navigations by default. Is there a way to do so?

Upvotes: 1

Views: 100

Answers (1)

Omar
Omar

Reputation: 31732

You can override changePage default on mobileinit. Place the code below after jquery.js and before jquery mobile.js in <head>.

$(document).on("mobileinit", function () {
  $.mobile.changePage.defaults.allowSamePageTransition = true;
});

Upvotes: 1

Related Questions