遮盖层实现(jQuery+css+html)
2024-08-22 15:45:24
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>遮盖层</title>
<style>
/* 登录层 */
#choose{
display:none;
width:360px;
height:230px;
background:#69F;
position:absolute;
top:%;
left:%;
z-index:;
opacity:0.8; /*背景的透明度:(Firefox适用;)*/
filter:alpha(opacity =); /*背景的透明度:(IE适用);*/
} /*遮罩层*/
#mid{
display:none;
width:%;
height:%;
background:#;
position:absolute;
top:;
left:;
z-index:;
opacity:0.4; /*背景的透明度:(Firefox适用;)*/
filter:alpha(opacity =); /*背景的透明度:(IE适用);
}
</style>
</head>
<body>
<a href="#" class="click">点击按钮</a>
<!--填充内容开始 往body里面写点内容,因为遮盖层要通过body去获取界面的高宽度,从而body的高宽同时决定了遮盖层的高宽。但是码友们在平时运用这个demo的时候,由于所写body的代码肯定是有的,而且是比较多的,所以一定要忽略我下面填充的内容->
1<br />1<br />1<br />1<br /> 1<br /> 1<br /> 1<br /> 1<br />1<br />1<br />1<br /> 1<br /> 1<br /> 1<br /> 1<br />1<br />1<br />1<br /> 1<br /> 1<br /> 1<br /> 1<br />1<br />1<br />1<br /> 1<br /> 1<br /> 1<br /> 1<br />1<br />1<br />1<br /> 1<br /> 1<br /> 1<br /> 1<br />1<br />1<br />1<br /> 1<br /> 1<br /> 1<br />
1<br />1<br />1<br />1<br /> 1<br /> 1<br /> 1<br /> 1<br />1<br />1<br />1<br /> 1<br /> 1<br /> 1<br /> 1<br />1<br />1<br />1<br /> 1<br /> 1<br /> 1<br /> 1<br />1<br />
<!-- 填充内容结束 -->
<!-- 表单层 -->
<div id="choose"> <!-- 表单头部 -->
<a class=close>关闭</a>
<table>
<tr>
<td colspan="3" class="td">
</td>
</tr>
<tr>
<td class="td1">登录名:</td>
<td class="td2"><input type="text"/></td>
<td class="td3">*</td>
</tr>
<tr>
<td class="td1">密 码:</td>
<td class="td2"><input type="password"/></td>
<td class="td3">*</td>
</tr>
<tr>
<td class="td1">验证码:</td>
<td class="td2"><input type="text"/></td>
<td class="td3">*</td>
</tr>
<tr>
<td colspan="3" align="center"><input type="submit" value="登陆"/></td>
</tr>
</table>
</div> <!-- 遮盖层 -->
<div id="mid"></div>
</body>
<script type="text/javascript" src="js/jquery-1.11.2.min.js" ></script>
<script>
$(function(){
$(".click").click(function(){
var bh = $("body").height(); //获取当前浏览器界面的高度
var bw = $("body").width(); //获取当前浏览器界面的宽度
$("#mid").css({
height:bh, //给遮盖层的div的高宽度赋值
width:bw,
display:"block" //遮盖层显示
});
$("#choose").show();
});
$(".close").click(function(){
$("#choose").hide();
$("#mid").hide();
});
});
</script>
</html>
最新文章
- jQuery插件中文乱码解决办法
- Session与cookie的区别?
- WIN7 java7 环境变量配置
- SQL Server 性能优化之——T-SQL NOT IN 和 NOT Exists
- Linux 实现自动安装服务组件以及优化内核参数 (转)
- poj 1986 Distance Queries
- asp.net mvc4 使用KindEditor文本编辑器
- ABP+AdminLTE+Bootstrap Table权限管理系统第五节--WBEAPI及SwaggerUI
- pc端手機端自適應佈局方案
- 缓存系列之二:CDN与其他层面缓存
- U32592 摘果实
- LInux系统木马植入排查分析 及 应用漏洞修复配置(隐藏bannner版本等)
- ASP.NET MVC中有四种过滤器类型
- HDOJ 2008 数值统计
- hdu1102(最小生成树水题)
- C++ template —— 智能指针(十二)
- mybatis项目启动报错 The content of element type ";resultMap"; must match ";(constructor?,id*,result*,association*,collection*,discriminator?)";.
- linux command curl and sha256sum implement download verification package
- tf.unstack\tf.unstack
- 使用CXF实现基于Rest方式的WebService
热门文章
- The Linux Mint 17.1:Eclipse Run The C++ And Python Configoration
- [bzoj4540][Hnoi2016][序列] (莫队算法+单调栈+st表)
- js学习笔记1
- [JS]省市区数据及方法调用
- zabbix 布署实践【2 agent安装】
- CentOS7 下安装telnet服务
- CodeForces 645D Robot Rapping Results Report
- HDU 5895 Mathematician QSC
- Android使用Eclipse遇到";java.lang.ClassNotFoundException";
- 【bootstrap】时间选择器datetimepicker和daterangepicker