JS控制弹窗大小及位置

来源:互联网 发布:下载网站软件 编辑:程序博客网 时间:2024/05/21 19:29

function Screen() {
var num, num1;
//num=screen.availHeight;
//num1=screen.availWidth;
num = screen.height;
num1 = screen.width;
}
function openURL(url) {

//500 是弹窗的总高度,770为弹窗的总宽度。
var top = (screen.availHeight - 500) / 2;
var left = (screen.availWidth - 770) / 2;

window.open(url,'newwindow','height=500, width=770, top='+top+', left='+left+', toolbar=no, menubar=no, scrollbars=yes,resizable=no,location=no, status=no')
}


原创粉丝点击