欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

[转]window.open居中

发布时间:2025/6/17 40 豆豆
生活随笔 收集整理的这篇文章主要介绍了 [转]window.open居中 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

方法:

1 function openWin(u, w, h) { 2 var l = (screen.width - w) / 2; 3 var t = (screen.height - h) / 2; 4 var s = 'width=' + w + ', height=' + h + ', top=' + t + ', left=' + l; 5 s += ', toolbar=no, scrollbars=no, menubar=no, location=no, resizable=no'; 6 open(u, 'oWin', s); 7 }

 

示例:

<a href="javascript:void(openWin('http://www.baidu.com/', 600, 500));">Test</a>

 

 

来源:http://blog.csdn.net/liguohuaty/article/details/3467069

转载于:https://www.cnblogs.com/seasons1987/archive/2012/06/28/2568374.html

总结

以上是生活随笔为你收集整理的[转]window.open居中的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。