user1271775
user1271775

Reputation: 93

jQMobile defaultPageTransition doesn't work

I'm using jQMobile for my Web application. i'm using the latest version 1.1.1.

i try to set by default the $.mobile.defaultPageTransition = "slide";

But it's doesn't work, and when i change the version of jQMobile to jquery.mobile-1.0b2 it's work fine.

Any suggestion ?

Code :

$(document).bind("mobileinit", function(){
  $.mobile.defaultPageTransition = "slide";
});

Upvotes: 1

Views: 2626

Answers (1)

David
David

Reputation: 121

Move the code into its own file, say "custom-init.js".

$(document).bind("mobileinit", function() { 
    $.mobile.defaultPageTransition = "slide";
});

In your script imports, include "custom-init.js" after you include jQuery, but before you include jQuery Mobile:

<script src="jquery-1.7.1.min.js"></script>
<script src="custom-init.js"></script>
<script src="jquery.mobile-1.1.1.min.js"></script>

That should get it working for you.

Upvotes: 12

Related Questions