数据加载遮罩层

来源:互联网 发布:淘宝新帽城 编辑:程序博客网 时间:2024/05/14 11:33

项目中加载数据时,为了在加载时有一种效率,自然会加个遮罩层或是加载数据进度条,


/** * 数据加载遮罩层 */startMask : function() {if ($("#loading").length > 0){$("#loading").remove();}var height = window.screen.height - 180;var width = window.screen.width;var leftW = 300;if (width > 1200) {leftW = 500;} else if (width > 1000) {leftW = 350;} else {leftW = 100;}var _html = "<div id='loading' style=\"position:absolute;left:0;width:100%;height:"+ height+ "px;top:0;background:#E0ECFF;opacity:0.8;filter:alpha(opacity=60);\">"+ "<div style=\"position:absolute;  cursor1:wait;left:"+ leftW+ "px;top:200px;width:auto;height:60px;padding:20px 5px 10px 50px;background:#fff url('Script/themes/img/pagination_loading.gif') no-repeat scroll 5px 14px;border:2px solid #ccc;color:#000;\">正在加载,请等待...</div></div>";$("#content").append(_html);},/** * 去掉遮罩层 */endMask : function() {$("#loading").remove();}


0 0