javascript 获取浏览中的网页的中心轴..急急急

来源:百度知道 编辑:UC知道 时间:2024/06/01 09:01:16
整个网页是居中对齐的..我想通过获得网页的中心轴再计算div层的位置~~

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
var geometry={};
if(window.innerWidth){
geometry.getViewportWidth=function(){
return window.innerWidth;
}
}else if(document.documentElement && document.documentElement.clientWidth){
geometry.getViewportWidth=function(){
return document.documentElement.clientWidth;
}
}else if(document.body.clientWidth){
geometry