页面设置遮罩层

<style>
  .mask {position:absolute;background:rgba(0,0,0,0.2) url(../image/loading.png) no-repeat center center;z-index: 9999; opacity: 0.5;-moz-opacity:0.5;}
</style>
<div id="mask" class="mask"></div>

数据加载之前显示遮罩层

  $("#mask").css("height",$(document).height());
  $("#mask").css("width",$(document).width());
  $("#mask").show();

加载之后隐藏
 $("#mask").hide(); 

猜你喜欢

转载自www.cnblogs.com/gaomanito/p/9927611.html