代码改变世界

弹出一个窗体

2011-09-27 16:26  前端小鬼  阅读(206)  评论(0)    收藏  举报

function OpenNewWin(url,id,width,height,openStat){               
    var myExploer = navigator.appName;
    if(myExploer == "Microsoft Internet Explorer"){
            showModalDialog(url,window,"dialogWidth:"+ width +"px;dialogHeight:"+ height +"px;help:no;scroll:no;status:yes;resizable:no");
    }else{
            win_left = (screen.width-width)/2;
            win_top = (screen.height-height)/2;
            win_option = "location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,alwaysRaised=yes,resizable=no,width="+ width +",height="+ height +",top="+ win_top +",left="+ win_left
            window.open(url,id,win_option,true);
    }
}