弹出一个遮罩层有正在加载效果的文字
建站知识 2021-07-03 08:15www.168986.cn长沙网站建设
实现
<!doctype html>
<html>
<head>
<title>遮罩层</title>
<meta charset="utf-8" />
<style>
#cover{
display:none;
position:fixed;
z-index:1;
:0;
left:0;
width:100%;
height:100%;
background:rgba(0, 0, 0, 0.44);
}
#coverShow{
display:none;
position:fixed;
z-index:2;
:50%;
left:50%;
border:1px solid #127386;
width:300px;
height:100px;
margin-left:-150px;
margin-:-150px;
background:#127386;
}
</style>
<script>
function clickfunc()
{
alert("clicked, 遮住之前’测试‘按钮是起作用的");
}
function coverit()
{
var cover = document.getElementById("cover");
var covershow = document.getElementById("coverShow");
cover.style.display = 'block';
covershow.style.display = 'block';
alert("已经遮住,’测试‘按钮已经不起作用了");
}
</script>
</head>
<body>
<div id="cover"></div>
<div id="coverShow">
<table align="center" border="0" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse; height: 100px; min-height: 100px;" bgcolor="#127386">
<tr>
<td height="30" style="font-size: 12px;">正在加载,请稍后......</td>
</tr>
<tr>
<td align="center" bgcolor="#ffffff">
这里加载一个img src为动态的gif
</td>
</tr>
</table>
</div>
<div>
这里面是内容
<span>所有的内容都被cover遮住</span>
<div>
<font style="color:red">
两个遮罩层
<br/>
第一个遮罩层cover是将整个body盖住,width=100%,height=100%.
第二个遮罩层coverShow居中显示,可以在里面加载img元素。
</font>
</div>
<input type="button" value="测试" onclick="clickfunc()"/>
</div>
<input type="button" value="遮住" onclick="coverit()"/>
</body>
</html>
复制代码
代码如下:<!doctype html>
<html>
<head>
<title>遮罩层</title>
<meta charset="utf-8" />
<style>
#cover{
display:none;
position:fixed;
z-index:1;
:0;
left:0;
width:100%;
height:100%;
background:rgba(0, 0, 0, 0.44);
}
#coverShow{
display:none;
position:fixed;
z-index:2;
:50%;
left:50%;
border:1px solid #127386;
width:300px;
height:100px;
margin-left:-150px;
margin-:-150px;
background:#127386;
}
</style>
<script>
function clickfunc()
{
alert("clicked, 遮住之前’测试‘按钮是起作用的");
}
function coverit()
{
var cover = document.getElementById("cover");
var covershow = document.getElementById("coverShow");
cover.style.display = 'block';
covershow.style.display = 'block';
alert("已经遮住,’测试‘按钮已经不起作用了");
}
</script>
</head>
<body>
<div id="cover"></div>
<div id="coverShow">
<table align="center" border="0" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse; height: 100px; min-height: 100px;" bgcolor="#127386">
<tr>
<td height="30" style="font-size: 12px;">正在加载,请稍后......</td>
</tr>
<tr>
<td align="center" bgcolor="#ffffff">
这里加载一个img src为动态的gif
</td>
</tr>
</table>
</div>
<div>
这里面是内容
<span>所有的内容都被cover遮住</span>
<div>
<font style="color:red">
两个遮罩层
<br/>
第一个遮罩层cover是将整个body盖住,width=100%,height=100%.
第二个遮罩层coverShow居中显示,可以在里面加载img元素。
</font>
</div>
<input type="button" value="测试" onclick="clickfunc()"/>
</div>
<input type="button" value="遮住" onclick="coverit()"/>
</body>
</html>
长沙网站设计
- 如何进行东阳SEO关键词优化?
- 边坝哪有关键词排名优化:提升你的网站流量与
- 安国百度优化服务:提升您的在线可见性
- 阜康新手做SEO怎么做
- 山西seo网站排名关键词优化:提升您网站曝光率
- 临沂seo网站排名关键词优化:提高你的网站可见
- 广西SEO网站推广怎样付费比较合理
- 双辽SEO网站推广:提升你的网站可见性与流量
- 辽宁企业网站优化购买方式有哪些
- 提升宝清百度SEO排名的实用技巧与策略
- 静宁百度SEO排名:提升您网站曝光率的关键策略
- 彭州百度SEO排名的提升策略和实施指南
- 广南百度关键词SEO:提升网站排名的关键策略
- 辽宁关键词优化怎么做论坛营销
- 吉林百度seo排名如何做到让用户满意
- 内黄百度优化服务:提升在线可见性的关键