2

我正在将 jQuery Mobile 用于 PhoneGap 应用程序。当我尝试加载这样的内部页面时:

$.mobile.changePage('#loginPage', { transition: "none"} );

该应用程序等待片刻,然后页面更改为登录页面。是否可以在加载页面时显示加载消息?我知道 changePage 有一个 showLoadingMsg 选项,但仅适用于外部页面。

4

1 回答 1

0

使用$.mobile.showPageLoadingMsg();onpagebeforecreatepagebeforeshowevent(取决于您的情况),然后$.mobile.hidePageLoadingMsg();使用 on pageshowevent。像这样的东西:

$(document).on(
   'pageshow',
   '#loginPage'
   function()
   {
      $.mobile.hidePageLoadingMsg();
   }
);
于 2012-08-13T11:44:25.917 回答