记录一下:弹出DIV层代替弹出窗口
2010-07-04 20:02
148 查看
备注:待解决问题——关闭弹出层时,如何同时刷新原页面INDEX.HTML?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>index</title> <mce:style><!-- .divtitle{ width: 200px; height: 18px; background-image: url('/imgs/2.jpg'); font-size: small; font-weight: bold; } .closez{ cursor: pointer; padding-left:110px; } .divcontext{ font-size: smaller; border:1px solid red; width: 200px; height: 100px; background-color: white; } .divbutton{ padding-left: 150px; } --></mce:style><style mce_bogus="1">.divtitle{ width: 200px; height: 18px; background-image: url('/imgs/2.jpg'); font-size: small; font-weight: bold; } .closez{ cursor: pointer; padding-left:110px; } .divcontext{ font-size: smaller; border:1px solid red; width: 200px; height: 100px; background-color: white; } .divbutton{ padding-left: 150px; } </style> <mce:script type="text/javascript"><!-- /* 动态创建背景层; */ function _ungroupay() { var node = document.getElementById('sysbackgroupdis'); if (!node) { node = document.createElement('div'); node.setAttribute('id', 'sysbackgroupdis'); node.style.visibility = 'hidden'; node.style.height = document.body.clientHeight + 'px'; node.style.width = document.body.clientWidth + 'px'; node.style.background = '#999'; node.style.opacity = '0.5'; node.style.filter = 'alpha(opacity=60)'; node.style.position = 'absolute'; node.style.top = '-9999px'; document.body.appendChild(node); } node.style.top = '0px'; node.style.left = '0px'; node.style.visibility = 'visible'; node.style.zIndex = 1; } /*页面显示类容*/ _systemplate = "<div align=/"center/" class=/"maincontext/" id=/"maincontext/">"+ "<div id=/"divtitle/" class=/"divtitle/">标题<a class=/"closez/" onclick=/"javascript:logoutdisp();/">关闭</a></div>"+ "<div id=/"divcontext/" class=/"divcontext/">"+ "<input type=/"button/" value=/"确定/" onclick=/"javascript:alert('提交');/"><p>填入其他代码</div>< /div>"; /* 创建调度函数 */ function calldisp() { _ungroupay(); var node = document.getElementById('onbackground'); if (!node) { node = document.createElement('div'); node.setAttribute('id', 'onbackground'); node.style.visibility = 'hidden'; node.style.top = '-9999px'; node.style.position = 'absolute'; node.style.border = '1px'; node.style.borderColor = 'black'; node.style.borderStyle = 'solid'; node.innerHTML = document.getElementById('maincontext').innerHTML; document.body.appendChild(node); } node.style.top = Math.floor(document.body.scrollTop+(document.body.clientHeight-node.offsetHeight)/2)+'px'; node.style.left = Math.floor(document.body.scrollLeft+(document.body.clientWidth-node.offsetWidth)/2)+'px'; node.style.visibility='visible'; node.style.zIndex = 999; } /*退出层*/ function logoutdisp() { var layerNode = document.getElementById("onbackground"); var underLayerNode = document.getElementById("sysbackgroupdis"); if (layerNode) { layerNode.style.visibility="hidden"; layerNode.style.top = "-9999px"; } if (underLayerNode) { underLayerNode.style.visibility="hidden"; underLayerNode.style.top = "-9999px"; } } // --></mce:script> </head> <body> <div id="main" align="center"> <input type="button" value="打开层" onclick="javascript:calldisp();"> </div> <div style="display: none;" mce_style="display: none;"> <div align="center" class="maincontext" id="maincontext"> <div id="divtitle" class="divtitle">标题<a class="closez" onclick="javascript:logoutdisp();">关闭</a></div> <div id="divcontext" class="divcontext"><!--填写你需要的代码 start--> <p>填入代码</p> <div>输入:<input type="text"/></div> <!--填写你需要的代码 end--> <div class="divbutton"> <input id="button" class="button" type="button" value="确定" onclick="javascript:logoutdisp();"> </div> </div> </div> </div> </body> </html>
相关文章推荐
- 以层代替弹出窗口的例子,弹出DIV层窗口
- 用jQuery实现弹出窗口/弹出div层
- jQuery实现单击弹出Div层窗口效果(可关闭可拖动)
- Jquery:JS弹出窗口DIV层效果
- JavaScript弹出窗口DIV层效果代码 [
- Jquery教程:JS弹出窗口DIV层效果代码
- jQuery实现单击弹出Div层窗口效果(可关闭可拖动)
- PB数据窗口中用Enter 代替Tab在字段间移动,移动到最后一列弹出保存提示
- JAVASCRIPT弹出窗口DIV层效果代码
- JavaScript弹出窗口DIV层效果代码
- AD认证模式下如何通过表单登录来代替WINDOWS弹出窗口的方法
- 弹出div层窗口
- 在DataGrid中删除记录时弹出确认窗口
- JavaScript弹出窗口DIV层效果代码
- 网页右下角弹出框,记录一下
- 弹出窗口,回填记录的操作
- 一个很好的模拟弹出窗口的特效 偶尔看到了收藏一下- -b
- 自定义底部弹出Dialog(老掉牙的需求还是记录一下吧)
- 20100730 学习记录:gridview页脚加合计 & 逆向查找字符串 & 点图片弹出窗口
- 在网上找了一些Jquery弹出窗口,感觉不错记录下来。