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
Release: 2016-05-16 17:32:16
Original
1647 people have browsed it

[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

 
 
 
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template