Jquery Mobile pageLoading()方法如何工作?

raj*_*504 2 jquery-mobile

我是Jquery Mobile的新手,并在重新开发这个移动网站时尝试学习它.所以我使用data-role ="page"进行不同div的所有导航.并使用#pagename导航.我的问题是以这种方式进行导航,如何使用加载消息并等待转换,直到加载下一页?我尝试将$ .mobile.pageLoading()放在链接的onClick属性中,但这不起作用.

Hom*_*mer 6

使用JQM 1.0 beta 1

//show
$.mobile.showPageLoadingMsg();

//hide
$.mobile.hidePageLoadingMsg();
Run Code Online (Sandbox Code Playgroud)

http://jquerymobile.com/demos/1.0b1/#/demos/1.0b1/docs/api/methods.html

http://jquerymobile.com/test/docs/api/methods.html

更新:

此方法也是官方1.0版本中可接受的方法.

http://code.jquery.com/mobile/latest/demos/docs/api/methods.html

mobile.showPageLoadingMsg()

显示页面加载消息,可通过$ .mobile.loadingMessage配置.例:

//cue the page loader 
$.mobile.showPageLoadingMsg();
Run Code Online (Sandbox Code Playgroud)

$ .mobile.hidePageLoadingMsg()

隐藏页面加载消息,可通过$ .mobile.loadingMessage配置.例:

//cue the page loader           
$.mobile.hidePageLoadingMsg();
Run Code Online (Sandbox Code Playgroud)