1234567891011121314151617181920212223242526272829303132333435363738 |
- var huimvMobile = new Object();
- //显示加载器
- function showLoader() {
- //显示加载器.for jQuery Mobile 1.2.0
- $.mobile.loading('show', {
- text: '加载中...', //加载器中显示的文字
- textVisible: true, //是否显示文字
- theme: 'a', //加载器主题样式a-e
- textonly: false, //是否只显示文字
- html: "加载中..." //要显示的html内容,如图片等
- });
- }
-
- //隐藏加载器.for jQuery Mobile 1.2.0
- function hideLoader() {
- //隐藏加载器
- $.mobile.loading('hide');
- }
- huimvMobile.loadMobilePage = function(id, url, param, callback) {
- var obj = $("#" + id);
- //showLoader();
- var loadDivObj = jQuery('<div style="border:none;"><table cellspacing="0" cellpadding="0" height="60" style="border:none;"><tr style="border:none;"><td width="29%" style="border:none;"><div align="right" style="border:none;"><img src="images/progress.gif" /><div style="border:none;"><td style="border:none;"><td style="border:none;">页面加载中,请稍候...</td></tr></table></div>');
- obj.empty().append(loadDivObj);
- if (typeof(param) == 'undefined') {
- jQuery.ajaxSetup({
- cache : false
- });
- }
- obj.load(url, param, function() {
- //hideLoader();
- loadDivObj.hide("slow");
- if (callback) {
- callback();
- }
- });
- };
|