JavaScript弹出新窗口居中显示 代码如下:
<script language="javascript">
function openWin(u, w, h) {
var l = (screen.width - w) / 2;
var t = (screen.height - h) / 2;
var s = 'width=' + w + ', height=' + h + ', top=' + t + ', left=' + l;
s += ', toolbar=no, scrollbars=no, menubar=no, location=no, resizable=no';
open(u, 'oWin', s);
}
</script>
<a href="javascript:void(openWin('http://www.boxiangsk.com/', 600, 500));">Test</a>