首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

【转】弹出窗口定位在荧幕的中央

2012-06-30 
【转】弹出窗口定位在屏幕的中央//根据屏幕居中 window.open(URL,,width+width+,height+height+,to

【转】弹出窗口定位在屏幕的中央
//根据屏幕居中
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);

热点排行