在系统操作时,经常遇到数据加载的情况,希望弹出一个层提示"加载中,稍后。。。" 而背景则为灰色不可操作的状态,样式可以自己改
<div id="loading" style="background:#CC4444;color:#FFF;width:80px;padding-left:5px; position:absolute;line-height:22px;z-index:30;">加载中稍后...</div> 把这个换了就可以了,不要忘记 id="loading"
代码如下:
以下是引用片段:
<script type="text/javascript">
window.onload=function(){
var a = document.getElementById("loading");
var b = document.getElementById("backloading");
a.parentNode.removeChild(a);
b.parentNode.removeChild(b);
}
document.write('<div id="loading" style="background:#CC4444; color:#FFF;width:80px;padding-left:5px;position:absolute;line- height:22px;z-index:30;">加载中稍后...</div>');;
document.write('<div id="backloading" style="width:100%;height:100%;position:absolute;z-index:20;border:0px;background-color:#cccccc;filter:alpha(opacity=50);"align="center"></div>');
</script>
<body style="margin:0px;padding:0px;font-size:12px;overflow-y:hidden;z-index:0;" >
<iframe src="http://www.wyxg.com " width="100%" height="100%" frameborder="0" marginwidth="0" marginheight="0"></iframe>
</body> |