我是 Jquery Mobile 的新手,并在重新开发此移动网站时尝试学习它。因此,我使用 data-role="page" 使用不同的 div 进行所有导航。并使用#pagename 进行导航。我的问题是以这种方式进行导航,如何使用加载消息并等待进行转换,直到加载下一页?我尝试将 $.mobile.pageLoading() 放入链接的 onClick 属性中,但这不起作用。
使用 JQM 1.0 beta 1
//show
$.mobile.showPageLoadingMsg();
//hide
$.mobile.hidePageLoadingMsg();
http://jquerymobile.com/demos/1.0b1/#/demos/1.0b1/docs/api/methods.html http://jquerymobile.com/demos/1.0b1/#/demos/1.0b1/docs/api/methods.html
http://jquerymobile.com/test/docs/api/methods.html http://jquerymobile.com/test/docs/api/methods.html
Update:
这种方法也是官方1.0版本中公认的方法。
http://code.jquery.com/mobile/latest/demos/docs/api/methods.html http://code.jquery.com/mobile/latest/demos/docs/api/methods.html
移动.showPageLoadingMsg ()
显示页面加载消息,可通过 $.mobile.loadingMessage 配置。
例子:
//cue the page loader
$.mobile.showPageLoadingMsg();
$.mobile.hidePageLoadingMsg()
隐藏页面加载消息,可通过 $.mobile.loadingMessage 配置。
例子:
//cue the page loader
$.mobile.hidePageLoadingMsg();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)