window.open 的参数里只有设置左右边距,但显示器不同分辨率就不同,不能设死。请问,有其他方法吗?
解决方案 »
- 关于SyntaxError: unterminated string literal的问题
- parent.frames.3 为空或不是对象
- 一个<a href> Click带来麻烦
- 请教大师一个Checkbox取值的问题
- 不用FORM是否可以提交表单
- 请问如何取得元素的父对象?急用,在线等
- 一个难题啊,请各位大哥,进来看一下啊。
- 我想让一个网页一次只能有一个客户访问,访问的客户关闭了网页,另一个客户才能访问到。
- 在提交表單時, 如果 有selected 控件, 我不想手動選取, 讓它自動選取所有的項目, 可以實現嗎?
- 如何用jquery 控制子div下的孙子div的样式
- 怎么传递参数???
- document.forms['form1']和document.form1有什么区别?
window.open 的参数用变量呀
<script>
function openwin(){
var width=Math.round((window.screen.width-400)/2);
var height=Math.round((window.screen.height-200)/2);
window.open('http://www.baidu.com', 'newwindow', 'height=200, width=400, top='+height+',left='+width+',toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
}
</script>
<a href="javascript:void(0)" onclick="openwin();">同意交换</a>
<a href="javascript:void(0)" onclick="window.open('http://www.baidu.com', 'newwindow', 'height=200, width=400, top='+Math.round((window.screen.height-200)/2)+',left='+Math.round((window.screen.width-400)/2)+',toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')">同意交换</a>