その理由は、最初のケースでは JQM がページ変更を行うためです。2 番目のケースでは、場所を変更してページを手動で変更します。ajaxを使ったjqueryで変更されたページはページ遷移を取得します。
トランジションをスライドに変更するには、デフォルト設定を構成できます$.mobile.defaultPageTransition = "slide";
。関数を
使用してページを切り替えます。関数がページ遷移を行います。$.mobile.changePage()
changePage()
<!-- html -->
<a class="testLink" data-transition="slide">abc</a>
//js
$(document).off('pagechange');
$(document).on('pagechange', function (e, ui) {
// generally written in pagechange event.
$('.testLink').off();
$('.testLink').on('click', function (e) {
$.mobile.changePage('test.html', {
changeHash: true,
dataUrl: "test", //the url fragment that will be displayed for the test.html page
transition: "slide" //if not specified used the default one or the one defined in the default settings
});
});
});