javascript模仿msgbox提示效果代码_javascript技巧_脚本之家

复制代码
代码如下://前任作者:
//修改:hh13774978@126.com,rayking function${
returndocument.getElementById; } function_{
returndocument.getElementsByTagName; }
functionmsg(boxtitle,boxtype,boxwidth,msg,url){ $.style.width=boxwidth;
$.style.left=[0].clientWidth-boxwidth)/2;
$.style.top=[0].clientHeight-220)/2; varmsg_div_main_but_tmp=”

” +”确定”; switch{ case1:
$(“msg_div_main_content”).innerHTML=msg+msg_div_main_but_tmp;
//$.focus(); break; case2:
$(“msg_javascript模仿msgbox提示效果代码_javascript技巧_脚本之家。div_main_content”).innerHTML=msg+msg_div_main_but_tmp
+”取消”; //$.focus(); break; case3:
$(“msg_div_main_content”).innerHTML=msg; break; defualt:
$(“msg_div_main_content”).innerHTML=msg; break; }
$.innerHTML=boxtitle; $.style.zIndex=200; $.style.display=””; if{//IE
if(!$) { document.body.appendChild(document.createElement(“”)); }
$.style.zIndex=100; $.style.display=””; $.oncontextmenu=function() {
returnfalse; } $.style.zIndex=99; $.style.display=””;
$.oncontextmenu=function() { returnfalse; } }else{ $.style.zIndex=100;
$.style.display=””; $.oncontextmenu=function() { returnfalse; } }
$.oncontextmenu=function(){ returnfalse; } }
functionmsg_close_tmp_biyuan.style.display=’none’;
$.style.display=’none’; if{ $.style.display=’none’;} }
//加入对话框移动代码 /*鼠标拖动*/ varoDrag=””; varox,oy,nx,ny,dy,dx;
functiondrag{ vare=e?e:event; varmouseD=document.all?1:0; if { if {
oDrag=o.parentNode; } else{oDrag=o;} ox=e.clientX; oy=e.clientY; } }
functiondragPro { //varobj=document.getElementById;//拖动的id
varobj=oDrag;//拖动的id vare=e?e:event; obj.style.position=’absolute’;
dx=parseInt; dy=parseInt; if{dx=0;} if{dy=0;} nx=e.clientX;
ny=e.clientY; obj.style.left=+”px”; obj.style.top=+”px”; ox=nx; oy=ny; }
} document.onmouseup=function(){oDrag=””;}
document.onmousemove=function;} document.writeln(“”
+”#msg_div_all,#msg_div_all_Iframe{width:100%;height:100%;position:absolute;filter:Alpha;opacity:0.7;background:#EFEFEF;}”
+”#msg_div_main{position:absolute;}”
+”#msg_div_main_title{font-size:12px;color:#2C71AF;font-family:verdana;cursor:default;}”
+”#msg_div_main_content{font-size:14px;color:#2C71AF;padding-left:8px;}”
+”.msg_div_main_but{background:url;width:65px;heigt:20px;border:none;padding-top:3px;font-size:12px;}”
+”” +”” +”” +”” +”” +”

” +”” +”” +”” +”” +”” +”

” +”” +”” +”

” +”” +”

” +”” +”

” +”

” +”” +”” +”” +”

” +”” +””);在线演示打包下载

发表评论

电子邮件地址不会被公开。 必填项已用*标注