网站地图
首页
php教程
asp.net教程
手机开发
css教程
网页制作
办公数码
jsp教程
asp教程
ps教程
当前位置:
编程学习网
>>
php教程
>
php常用代码
> >
仿windows关机对话框_仿windows关机对话框的提示框效果
仿windows关机对话框_仿windows关机对话框的提示框效果
发布时间:2018-01-13
【www.gdgbn.com--php常用代码】
提示:您可以先修改部分代码再运行
<script language="javascript"> </script> <script> "); window.imb_FormModal.document.write(""); window.imb_FormModal.document.write(""); window.imb_FormModal.document.write(""); window.imb_FormModal.document.write(""); window.imb_FormModal.document.write(""); window.imb_FormModal.document.close(); } } // 显示对话框控件. this.ShowModal = function(iCaption, iMessage, iWidth, iHeight, iClickFunc, iOther){ var smWidth = 420, smHeight = 180, smCaption = "默认对话框", smMessage="您确定执行这项操作吗?", smFunc, smObject, smAlpha, smInterval; if (arguments.length > 4 ){ smWidth = iWidth; smHeight = iHeight; smCaption = iCaption; smMessage = iMessage; smFunc = iClickFunc; } // 背景的渐显. function checkIMBAlpha(){ smObject.style.filter = "alpha(opacity="+smAlpha+");"; smAlpha += 10; if (smAlpha>80){ clearInterval(smInterval); } } checkIMBObject(); this.BackObject = document.getElementById("imb_Background"); this.FormObject = document.getElementById("imb_FormModal"); smObject = this.BackObject; smAlpha = 0; this.BackObject.style.left = 0; this.BackObject.style.top = 0; this.BackObject.style.width = document.body.scrollWidth; this.BackObject.style.height = document.body.scrollHeight; this.BackObject.style.visibility = "visible"; smInterval = window.setInterval(checkIMBAlpha, 5); this.FormObject.style.left = document.body.clientWidth/2 - smWidth/2; this.FormObject.style.top = document.body.clientHeight/2 - smHeight/2; this.FormObject.style.width = smWidth; this.FormObject.style.height = smHeight; this.FormObject.style.visibility = "visible"; window.imb_FormModal.document.getElementById("imb_Title").innerHTML = "
" + smCaption + "
" + " -- 操作提示"; window.imb_FormModal.document.getElementById("imb_Content").innerHTML = smMessage; if (iOther==null || iOther==""){ window.imb_FormModal.document.getElementById("imb_Body").innerHTML = "
"; }else{ window.imb_FormModal.document.getElementById("imb_Body").innerHTML = "
"; } document.body.disabled = true; window.imb_FormModal.document.getElementById("imb_Ok").onclick= function(){ parent.document.body.disabled = false; if (smFunc!=null && smFunc!=""){ eval("parent." + smFunc.replace("$","1")); } parent.document.getElementById("imb_Background").style.visibility = "hidden"; parent.document.getElementById("imb_FormModal").style.visibility = "hidden"; } window.imb_FormModal.document.getElementById("imb_Cancel").onclick= function(){ if (smFunc!=null && smFunc!=""){ eval("parent." + smFunc.replace("$","2")); } parent.document.body.disabled = false; parent.document.getElementById("imb_Background").style.visibility = "hidden"; parent.document.getElementById("imb_FormModal").style.visibility = "hidden"; } window.imb_FormModal.document.getElementById("imb_Other").onclick= function(){ if (smFunc!=null && smFunc!=""){ eval("parent." + smFunc.replace("$","3")); } parent.document.body.disabled = false; parent.document.getElementById("imb_Background").style.visibility = "hidden"; parent.document.getElementById("imb_FormModal").style.visibility = "hidden"; } } } //--> </script>