日期:2014-05-16  浏览次数:20406 次

如果取得网页的中心点的坐标
想在页面中心位置弹出窗口,这个坐标怎么算???

------解决方案--------------------
var obj = newWindow;
obj.style.left = (document.body.clientWidth - obj.width)/2;
obj.style.top = (document.body.clientHeight - obj.height)/2;
------解决方案--------------------
document.body.clientWidth,和document.body.clientHeight可以敢取得页面高宽
screen.width,screen.height可以取得屏幕高宽