验证中...
window.open
Raw Copy
function openCenterWindow(width, height, url) {
let l=(window.screenX ? window.screenX: window.screenLeft) + (screen.availWidth-width)/2;
let t=(screen.availHeight-height)/2;
// l和t的求值非常关键,需要用到 window.screenX解决双屏显示的问题
window.open(
url,
'_blank',
`width=${width}, height=${height}, left=${l}, top=${t}`
);
}

Comment list( 0 )

You need to Sign in for post a comment

Help Search