首页 新闻 会员 周边 捐助

网页如何根据分辨率的大小而自动的调整

0
悬赏园豆:30 [已关闭问题]

如题

页面代码有点多(html页面),在这就不弄出来了。我qq是305249360,知道的请加我下,我把页面发过去帮我调整下,谢谢了

tertyufer的主页 tertyufer | 初学一级 | 园豆:35
提问于:2008-12-19 10:15
< >
分享
其他回答(3)
0

  <script language ="javascript" type ="text/javascript">
             function SetMaxWindow()
            {
                window.moveTo(-4,-4)
                window.resizeTo(screen.availWidth+9,screen.availHeight+9)
            }
  </script>

West | 园豆:1095 (小虾三级) | 2008-12-19 10:17
0

使用DIV+CSS布局时,对于框架部分使用with属性按照百分比设置,这样在大屏幕等也是按照百分比显示的,就达到了你的页面自动调整的效果。

GUO Xingwang | 园豆:3885 (老鸟四级) | 2008-12-19 10:42
0

with属性用百分比设置的时候,宽度之和要小于100%,不然会出错

seraph_uft | 园豆:205 (菜鸟二级) | 2008-12-19 10:55
0

<script type="text/javascript" language="javascript">
function getClientBounds()
{
var clientWidth;
var clientHeight;
switch(Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
clientWidth
= document.documentElement.clientWidth;
clientHeight
= document.documentElement.clientHeight;
break;
case Sys.Browser.Safari:
clientWidth
= window.innerWidth;
clientHeight
= window.innerHeight;
break;
case Sys.Browser.Opera:
clientWidth
= Math.min(window.innerWidth, document.body.clientWidth);
clientHeight
= Math.min(window.innerHeight, document.body.clientHeight);
break;
default: // Sys.Browser.Firefox, etc.
clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
clientHeight
= Math.min(window.innerHeight, document.documentElement.clientHeight);
break;
}

return new Sys.UI.Bounds(0, 0, clientWidth, clientHeight);
}

function resizeElements()
{
var clientBounds = getClientBounds();
var clientWidth = clientBounds.width;
var clientHeight = clientBounds.height;

var bg = $get("modalProcessBackground");
bg.style.width
= Math.max(Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), clientWidth) + 'px';
bg.style.height
= Math.max(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), clientHeight) + 'px';

var scrollLeft = (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
var scrollTop = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
var dialog = $get("animationDialog");
dialog.style.left
= scrollLeft + "px";
dialog.style.top
= scrollTop + "px";
}

$addHandler(window,
"scroll", resizeElements);
$addHandler(window,
"resize", resizeElements);
resizeElements();
</script>

上不了岸的鱼 | 园豆:4613 (老鸟四级) | 2008-12-20 12:47
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册