首页 >web前端 >js教程 >js弹出窗口之弹出层的小例子_javascript技巧

js弹出窗口之弹出层的小例子_javascript技巧

WBOY
WBOY原创
2016-05-16 17:32:161656浏览

[html]

复制代码 代码如下:

 
 
 
弹出窗口 
 
 
<script> <BR>var baseText = null; <BR>function showPopup(w,h){ <BR> var popUp = document.getElementById("popupcontent"); <BR> popUp.style.top = "200px"; <BR> popUp.style.left = "200px"; <BR> popUp.style.width = w + "px"; <BR> popUp.style.height = h + "px"; <BR> if (baseText == null) baseText = popUp.innerHTML; <BR> popUp.innerHTML = baseText + "<div id=\"statusbar\"><input type=\"button\" value=\"Close window\" onClick=\"hidePopup();\"></script>
";    
    var sbar = document.getElementById("statusbar");    
    sbar.style.marginTop = (parseInt(h)-60) + "px";   
    popUp.style.visibility = "visible"; 

function hidePopup(){    
    var popUp = document.getElementById("popupcontent");    
    popUp.style.visibility = "hidden"; 

 
 
 
content
 

 

onclick

 
 
 
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn