|
Getting Monitors Size of Users
By
using JavaScript, you can get the size of a user's screen and
then you can use that information in other parts of your script.
i.e. discovers the screen size, writes the size in the current
browser window, then creates a new window to the full screen
size.
<HTML>
<HEAD>
<TITLE>Window with the full size
</TITLE>
</HEAD>
<SCRIPT LANGUAGE=JAVASCRIPT>
sWidth=0
sHeight=0
if (browname == "Netscape" &&
navigator.javaEnabled())
{
sWidth=java.awt.Toolkit.getDefaultToolkit().getScreenSize().width
sHeight=java.awt.Toolkit.getDefaultToolkit().getScreenSize().height
}
if (sWidth ==0 || sHeight ==0)
{
sWidth=640
sHeight=480
}
document.writeln("<H1>Your screen dimensions
are : " + sWidth + "x" + sHeight + "
.</H1>")
newWind=window.open("","newWind","width="+sWidth+",height="+sHeight)
</SCRIPT>
</HEAD>
</BODY>
</HTML>
|