js+div实现的windows关机效果
2007-09-23 19:04
337 查看
");
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";
}
}
}
//-->
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";
}
}
}
//-->
相关文章推荐
- js实现div拖动动画运行轨迹效果代码分享
- JS+DIV实现鼠标划过切换层效果的方法
- JS+DIV实现鼠标划过切换层效果的实例代码
- Div+css+js实现高度适应浏览器,做出的效果像winform
- js 鼠标拖动对象 可让任何div实现拖动效果
- js实现仿Windows风格选项卡和按钮效果实例
- js+div实现图片滚动效果代码
- JS+DIV 实现拖动效果
- 原生js实现div随鼠标移动效果
- JS+CSS实现几个DIV层上下移动交换位置的效果
- 在iframe里的页面编写js,实现在父窗口上创建动画效果展开和收缩的div(不变动iframe父窗口代码)
- js实现遮罩层划出效果是生成div而不是显示
- js实现遮罩层划出效果是生成div而不是显示
- JS实现DIV提示框的效果
- js 鼠标拖动对象 可让任何div实现拖动效果
- js 实现 鼠标拖动DIV 效果
- JS+DIV+CSS实现的经典标签切换效果代码
- JS+CSS实现鼠标经过弹出一个DIV框完整实例(带缓冲动画渐变效果)
- js实现一个可以兼容PC端和移动端的div拖动效果