<script language ="javascript" type ="text/javascript">
function SetMaxWindow()
{
window.moveTo(-4,-4)
window.resizeTo(screen.availWidth+9,screen.availHeight+9)
}
</script>
使用DIV+CSS布局时,对于框架部分使用with属性按照百分比设置,这样在大屏幕等也是按照百分比显示的,就达到了你的页面自动调整的效果。
with属性用百分比设置的时候,宽度之和要小于100%,不然会出错
<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>