屏幕上的弹出式窗口中央?如何将通过javascript打开的弹出窗口对齐?window.open函数的中心屏幕变量到当前选择的屏幕分辨率?
3 回答
摇曳的蔷薇
TA贡献1793条经验 获得超6个赞
function popupwindow(url, title, w, h) { var left = (screen.width/2)-(w/2); var top = (screen.height/2)-(h/2); return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);}
添加回答
举报
0/150
提交
取消