JS控制彈窗大小及位置

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')
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章