zoukankan      html  css  js  c++  java
  • [转]创建一个JavaScript弹出DIV窗口层的效果

    转自:https://www.cnblogs.com/freeliver54/p/4920388.html

     1 <!doctype html>
     2 <html lang="en">
     3 <head>
     4     <meta charset="UTF-8">
     5     <title>Document</title>
     6     <style>
     7 #popupcontent{ 
     8 position: absolute; 
     9 visibility: hidden; 
    10 overflow: hidden; 
    11 border:1px solid #CCC; 
    12 background-color:#F9F9F9; 
    13 border:1px solid #333; 
    14 padding:5px; 
    15 } 
    16     </style>
    17     <script>
    18 var baseText = null; 
    19 
    20 function showPopup(w,h){ 
    21 var popUp = document.getElementById("popupcontent"); 
    22 popUp.style.top = "150px"; 
    23 popUp.style.left = "150px"; 
    24 popUp.style.width = w + "px"; 
    25 popUp.style.height = h + "px"; 
    26 //if (baseText == null) baseText = popUp.innerHTML; 
    27 //popUp.innerHTML = baseText + "<div id="statusbar"><button onclick="hidePopup();">Close window</button></div>"; 
    28 //var sbar = document.getElementById("statusbar"); 
    29 //sbar.style.marginTop = (parseInt(h)-40) + "px"; 
    30 popUp.style.visibility = "visible"; 
    31 } 
    32 
    33 function hidePopup(){ 
    34 var popUp = document.getElementById("popupcontent"); 
    35 popUp.style.visibility = "hidden"; 
    36 } 
    37 
    38 
    39     </script>
    40 </head>
    41 <body>
    42     <a href="#" onclick="showPopup(600,600);" >Open popup</a> 
    43     <div id="popupcontent">这是一个DIV弹窗效果!相关内容如下
    44     <iframe src="Agree.html" width="500px" height="500px;" scroll="auto"></iframe>
    45     <div id="statusbar"><button onclick="hidePopup();">Close window</button></div>
    46     </div>
    47     
    48 </body>
    49 </html>
  • 相关阅读:
    安装JDK,如何配置PATH,如何配置CLASSPATH
    存储过程笔记
    用BeanFactoryAware接口,用BEAN的名称来获取BEAN对象
    静态工厂实例代码
    setTimeout 和 setInterval 的区别
    Spring Autowire自动装配
    动态工厂模式代码实例
    JS处理回车事件
    不错的Spring学习笔记(转)
    单例模式要点
  • 原文地址:https://www.cnblogs.com/sharpest/p/10142502.html
Copyright © 2011-2022 走看看