html5 - jQuery mobile page transition -


i using jquery mobile page transition feature in application (html5 mobile app) with:

<a href="test.html" data-transition="slide">abc</a> 

page transition works fine (the slide animation) with:

<a onclick="document.location.href = 'test.html';" data-transition="slide">abc</a>  

page transition doesn't works, navigates doesn't slide.

i want page transition work second option.
please help

the reason in first case, jqm page change. in second case, manually change page changing location. pages gets changed jquery using ajax gets page transition.
change transition slide can configure default settings $.mobile.defaultpagetransition = "slide";.
use $.mobile.changepage() function change pages. changepage() function page transitions you.

<!-- html --> <a class="testlink" data-transition="slide">abc</a> 

//js

$(document).off('pagechange'); $(document).on('pagechange', function (e, ui) {     // written in pagechange event.     $('.testlink').off();     $('.testlink').on('click', function (e) {         $.mobile.changepage('test.html', {             changehash: true,             dataurl: "test",    //the url fragment displayed test.html page             transition: "slide"  //if not specified used default 1 or 1 defined in default settings         });     }); }); 

Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -