Home >Web Front-end >JS Tutorial >A small example of the pop-up layer of js pop-up window_javascript skills

A small example of the pop-up layer of js pop-up window_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:32:161656browse

[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();"></div>";     <br>    var sbar = document.getElementById("statusbar");     <br>    sbar.style.marginTop = (parseInt(h)-60) "px";    <br>    popUp.style.visibility = "visible";  <br>}  <br>function hidePopup(){     <br>    var popUp = document.getElementById("popupcontent");     <br>    popUp.style.visibility = "hidden";  <br>}  <br></script> 
 
 
content
 

 

onclick

 
 
 
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn