js实现全屏弹框
2017-06-22 18:37
176 查看
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>全屏弹框</title> <style type="text/css"> #DialogsAlert{ width:505px; background-color:#fff; text-align:center; font-size:14px; color:#767676; font-family:"microsoft yahei",simsun,Tahoma,sans-serif; display: none; z-index: 9999; position:fixed; top:28%; left:36%; } #DialogsAlert h2{ height:40px; } .act_pop_title{ background: #005C91; color:#ffffff; text-align: left; text-indent: 30px; line-height: 40px; height:40px; } .Dialogs-Close{ width:40px; height:40px; right:-45px; top:0; position:absolute; background-position: -419px 3px; z-index: 5; background-color: #005c91; color: #ffffff; font-size: 32px; line-height: 32px; } </style> </head> <body style="height:2000px;width:2000px"> <input type="button" value="点击显示弹框或者小区弹框" onclick="DialogS();"/> <div id="DialogsAlert" class="act_pop"> <a href="javascript:DialogS()" title="关闭"><span class="Dialogs-Close">X</span></a> <h2 class="act_pop_title">全屏弹框哦</h2> </div> <script type="text/javascript"> function DialogS(){ if(!(document.getElementById("Dialogs"))) { var oHead = document.getElementsByTagName("body")[0]; var oDiv = document.createElement("div"); oDiv.id = "Dialogs"; oDiv.style = "height:100%;width:100%;left:0;top:0;background:#ccc;position:fixed;filter:Alpha(opacity=50);opacity:0.5; -moz-opacity:0.5;"; oHead.appendChild(oDiv); document.getElementById("DialogsAlert").style.display = "block"; }else if(document.getElementById("Dialogs").style.display == "none"){ document.getElementById("DialogsAlert").style.display = "block"; document.getElementById("Dialogs").style.display = "block"; }else{ document.getElementById("DialogsAlert").style.display = "none"; document.getElementById("Dialogs").style.display = "none"; } } </script> </body> </html>
相关文章推荐
- js 实现弹框后页面不滚动
- JS或jQuery实现全屏
- js实现页面全屏
- 利用FullPage.js实现全屏滚动插件
- js实现div弹框和关闭
- Js实现弹框
- FullPage.js – 轻松实现全屏滚动(单页网站)效果
- 用html5 js实现点击一个按钮达到浏览器全屏效果
- 全屏滚动实现之fullPage.js(一)
- 全屏滚动实现之fullPage.js(二)
- 进入全屏 nodejs+express+mysql实现restful风格的增删改查示例
- 轻松实现全屏滚动-FullPage.js
- 全屏滚动实现:fullPage.js和fullPage
- 使用fullpage.js实现全屏滚动效果
- JS+CSS实现弹出全屏灰黑色透明遮罩效果的方法
- html5 js 实现浏览器全屏效果(F11)
- js实现全屏
- 用html5(requestFullscreen) js实现点击一个按钮使浏览器全屏效果
- 用Html5 or JS实现点击一个按钮达到浏览器全屏效果
- 利用浏览器全屏api实现js全屏