弹出的css实现
来源:互联网 发布:暗黑3 数据库 2.61 编辑:程序博客网 时间:2024/05/14 23:47
实现点击弹出,展现弹出层,点击关闭,关闭弹出层。
弹出层的fixed,里面的内容absoute。注意弹出层overflow哦
.body-wrap{
width: 100%;height: 2000px;
}
.button-small{
display: block;
width: 100px;
height: 50px;
background-color: #39BEE7;
border-radius: 5px;
text-align: center;
border: none;
cursor: pointer;
}
.tan-wrap{
width: 100%;
height: 100%;
position: fixed;
top: 0px;
left: 0px;
overflow: auto;
}
.tan-background{
width: 100%;
height: 1600px;
background-color: antiquewhite;
opacity: .3;
}
.tan-content{
width: 100%;
position: absolute;
top:0px;
left: 0px;
}
.tan-content-div{
width: 500px;
height: 1500px;
border: 1px solid red;
margin: 50px auto;
}
</style>
</head>
<body>
<div class="body-wrap">
<input class="button-small" type="button" name="tanchu" id="tanchu" value="弹出">
</div>
<div class="tan-wrap" style="display: none;" id="tanwrap">
<div class="tan-background"></div>
<div class="tan-content">
<div class="tan-content-div">
<input class="button-small" type="button" name="guanbi" id="guanbi" value="close">
</div>
</div>
</div>
<script src="../js/libs/jquery-1.11.3.js">
</script>
<script>
$("#tanchu").click(function () {
$("body").css({"overflow":"hidden"});
$("#tanwrap").css({"display":"block"});
});
$("#guanbi").click(function () {
$("body").css({"overflow":"auto"});
$("#tanwrap").css({"display":"none"});
});
</script>.body-wrap{
width: 100%;
height: 2000px;
}
.button-small{
display: block;
width: 100px;
height: 50px;
background-color: #39BEE7;
border-radius: 5px;
text-align: center;
border: none;
cursor: pointer;
}
.tan-wrap{
width: 100%;
height: 100%;
position: fixed;
top: 0px;
left: 0px;
overflow: auto;
}
.tan-background{
width: 100%;
height: 1600px;
background-color: antiquewhite;
opacity: .3;
}
.tan-content{
width: 100%;
position: absolute;
top:0px;
left: 0px;
}
.tan-content-div{
width: 500px;
height: 1500px;
border: 1px solid red;
margin: 50px auto;
}
</style>
</head>
<body>
<div class="body-wrap">
<input class="button-small" type="button" name="tanchu" id="tanchu" value="弹出">
</div>
<div class="tan-wrap" style="display: none;" id="tanwrap">
<div class="tan-background"></div>
<div class="tan-content">
<div class="tan-content-div">
<input class="button-small" type="button" name="guanbi" id="guanbi" value="close">
</div>
</div>
</div>
<script src="../js/libs/jquery-1.11.3.js">
</script>
<script>
$("#tanchu").click(function () {
$("body").css({"overflow":"hidden"});
$("#tanwrap").css({"display":"block"});
});
$("#guanbi").click(function () {
$("body").css({"overflow":"auto"});
$("#tanwrap").css({"display":"none"});
});
</script>
0 0
- 弹出的css实现
- 弹出层的CSS
- CSS实现横向弹出菜单
- js+css实现新窗口弹出
- JS+css实现弹出窗口
- Div+CSS实现始终居中的半透明弹出层
- 利用CSS、Jquery和div实现的横弹出菜单
- 常用的css弹出菜单
- javascript+css+html实现弹出层
- 纯js+css实现 页面弹出div
- CSS+jQuery实现弹出框代码
- html+css+js实现弹出框+遮罩层
- jqury+css实现可弹出伸缩层
- Jquery+div+css实现弹出登录窗口
- css实现弹出框在页面居中
- 实现简单弹出栏目js+css
- 用CSS实现的模式窗口效果,弹出固定大小的窗口
- 弹出窗口的实现
- SVN主干和分支合并原则
- 文章标题
- Android SDK Manager不能显示所有包的解决办法
- js实现下拉菜单提交表单后停留在选中option
- 铝电解电容容量和额定工作电压
- 弹出的css实现
- 哇 今天来学习一下 RecyclerView
- 【英迈吉】基于客观测试数据的影像质量评价方法研究
- Android通用流行框架大全
- 深度探索C++对象模型笔记---第五章&&第六章
- 经典数据结构 [ B树,B+树 ]
- 【spring】BeanPostProcessor使用场景之@Autowired
- 利用坐标筛选四边形(凸四边形,边不交叉)
- echarts全省地图下钻方法