//居中弹出窗体
function getwindow(URL,width,height)
{
//根据屏幕居中
window.open(URL,'','width='+width+',height='+height+',top='+(screen.height-height)/2+',left='+(screen.width-width)/2);
//下面是根据页面居中
//window.open(URL,'','width='+width+',height='+height+',top='+(document.body.offsetHeight-height)/2+',left='+(document.body.offsetWidth-width)/2);
//window.open(URL,'','width='+width+',height='+height+',top=250,left='+document.body.offsetWidth/3);
}
function getwindow(URL,width,height)
{
//根据屏幕居中
window.open(URL,'','width='+width+',height='+height+',top='+(screen.height-height)/2+',left='+(screen.width-width)/2);
//下面是根据页面居中
//window.open(URL,'','width='+width+',height='+height+',top='+(document.body.offsetHeight-height)/2+',left='+(document.body.offsetWidth-width)/2);
//window.open(URL,'','width='+width+',height='+height+',top=250,left='+document.body.offsetWidth/3);
}
解决方案 »
- 一个小功能已经实现,代码不是很明白。
- 用js捕捉鼠标连续点击三次事件怎么实现啊
- javaScript中怎么得到并使用从数据库中查询得到的数据
- 有关setTimeout的一点问题,请你进来帮个忙
- document.all.不能根eval吗?我怎么怎么改?
- ie提示语法错误,但是在其他浏览器没错
- 已经有了一个字串变量str1="abcsef" ,如何将它写到<textarea>中光标停留处去??
- 一个两天没有解决的问题,哪位大虾支招啊
- 请问如何用js得到一个页内所有控件的name??
- 能不能做一個cookie的數組啊?
- 关于正则表达式的问题,请指教!
- 一个困难的问题---------------如何进行表格的动态增加?????
<body>
....
</body>
<script>
top.moveTo(screen.width/2-document.body.clientWidth/2,screen.height/2-document.body.clientHeight/2)
</script>