使⽤js实现关闭js弹出层的窗⼝
<script type="text/javascript">
function toggle() {
theObj = ElementById('Sunyanzi').style;
if (  theObj.display == "none" ) theObj.display = "block"; else theObj.display = "none";
}
</script>
<div id="Sunyanzi" >你看我出现了~~~</div>
<br />
<input type="button" onclick="toggle()" value="点⼀下试试看 ...?" />
//创建你的弹出层
var dvMsg = ateElement("div");
strHtml =  "<div class='####'>弹出层内容</div>"
strHtml += " <div class='####'><input type='button' value='关闭' onclick='btnclick()'></div>"
dvMsg.innerHTML = strHtml;
document.body.appendChild(dvMsg);
js教程removechild// 关闭按钮
btnclick = function (){
veChild(dvMsg);
-------------------------
<div id="tanchu">弹出层内容</div>
function open(){
}
function close(){

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。