[Home]Determine window size

HomePage | RecentChanges | Preferences | Newbie Help

Some code I use to determine the maximum available window area:

<script language="JavaScript" type="text/javascript"><--
d=document;xMax=0;yMax=0;
if(d.getElementById){
 if(d.documentElement&&d.documentElement.clientHeight){
  xMax=d.documentElement.clientWidth;
  yMax=d.documentElement.clientHeight;
 }else{
  xMax=(d.all)?d.body.clientWidth:window.innerWidth;
  yMax=(d.all)?d.body.clientHeight:window.innerHeight;
 }
}else if(d.layers){
 xMax=window.innerWidth;
 yMax=window.innerHeight;
}
alert("X: "+xMax+", Y: "+yMax);
// -->
</script>

Kverens


HomePage | RecentChanges | Preferences | Newbie Help
This page is read-only | View other revisions
Last edited April 5, 2002 10:47 am (diff)
Search:

This FAQ is happily hosted by Betadome Digital Media