jquery-weui 页面加载提示showLoading

JS里面要有:
  $.showLoading = function(text) {
    var html = '<div class="weui_loading">';
    for(var i=0;i<12;i++) {
      html += '<div class="weui_loading_leaf weui_loading_leaf_' + i + '"></div>';
    }
    html += '</div>';
    html += '<p class="weui_toast_content">' + (text || "数据加载中") + '</p>';
    show(html, 'weui_loading_toast');
  }

  $.hideLoading = function() {
    hide();
  }

页面:
	$.showLoading("正在加载...");
        $.ajax({
            type:"POST", 
            url:url, 
            dataType:"json",   
            data:dataJson, 
            success:function(data){
            	$.hideLoading();
            } 
         }); 

猜你喜欢

转载自hnlixf.iteye.com/blog/2406496
今日推荐