一个js弹出div隐藏层的方法
2013-06-01 15:21
701 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<title>LIGHTBOX EXAMPLE</title>
<style>
.black_overlay{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); } .white_content { display: none; position: absolute;
top: 25%; left: 25%; width: 50%; height: 50%; padding: 16px; border: 16px solid orange; background-color: white; z-index:1002; overflow: auto; } </style>
</head>
<body>
<p>可以根据自己要求修改css样式<a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">点击这里打开窗口</a></p>
<div id="light" class="white_content">
This is the lightbox content.
<a href="javascript:void(0)" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">
Close</a></div>
<div id="fade" class="black_overlay">
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<title>LIGHTBOX EXAMPLE</title>
<style>
.black_overlay{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); } .white_content { display: none; position: absolute;
top: 25%; left: 25%; width: 50%; height: 50%; padding: 16px; border: 16px solid orange; background-color: white; z-index:1002; overflow: auto; } </style>
</head>
<body>
<p>可以根据自己要求修改css样式<a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">点击这里打开窗口</a></p>
<div id="light" class="white_content">
This is the lightbox content.
<a href="javascript:void(0)" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">
Close</a></div>
<div id="fade" class="black_overlay">
</div>
</body>
</html>
相关文章推荐
- js如何实现点击一个按钮显示一个div,然后该div上有一个按钮,点击此按钮后隐藏,隐藏的同时显示另外一个div,而在次弹出的div也有一个按钮,点击后隐藏.
- Js制作简单弹出层DIV在页面居中 中间显示遮罩的具体方法
- js+CSS实现弹出居中背景半透明div层的方法
- JS控制一个DIV层在指定时间内消失的方法
- JS如何获取一个未知DIV高度的方法
- 非常不错的弹出一个div的js代码
- js一个方法中的两个语句中间加alert弹出和不加alert弹出执行结果不一样
- 一个按钮控制div的显示与隐藏。运用jquery的toggle双、多事件绑定方法
- js实现鼠标移到链接文字弹出一个提示层的方法
- JS获取一个未知DIV高度的方法
- 一个jsp中用esayui dialog 弹出另一个jsp,并操作另一个jsp中js的变量和方法
- js弹出一个可拖拽的div+背景变灰
- jquery动态为个span,input,div,等标签赋值的方法总结,js动态隐藏div,
- js通过a链接控制多个DIV只显示其中一个其它隐藏
- 非常不错的弹出一个div的js代码
- js实现鼠标移到链接文字弹出一个提示层的方法
- JS隐藏div占用与不占用页面位置方法
- jquery和js实现对div的隐藏和显示方法
- js的一个例子 包括 如何隐藏div 现似乎div 向div写东西
- js+CSS实现弹出居中背景半透明div层的方法