11-09-2004, 03:20 AM
Is it possible to detect the viewer's desktop size using javascript? I have to know it in order to resize a javascript popup window according to the desktop size.
All I can find is code to detect the window size, just like this snippet:
All I can find is code to detect the window size, just like this snippet:
Code:
<script language=javascript>
if((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >=4)){
windowwidth = window.innerWidth;
windowheight = window.innerHeight;
}
else if((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >=4)){
windowwidth = document.body.clientWidth;
windowheight = document.body.clientHeight;
}else{
windowwidth = 800;
windowheight = 600;
}
document.write("Your browser window has a height of " + windowheight + ".
");
document.write("Your browser window has a width of " + windowwidth + ".
");
</script>
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i