L
laura
What is wrong with the following code to increase the size of my FP page
depending on the browser being used?
Can anyone help?
<SCRIPT LANGUAGE="javascript">
<!--
if(self.screen) { // true in N4
W = screen.width;
H = screen.height;
N = Math.pow( 2, screen.pixelDepth )
// Notes:
// -availWidth and availHeight returns screen size
// minus client interface's standard chromes.
// -pixelDepth isn't adapted for that purpose,
// returning the #bits for composing a palette
// -returned values are good even if user change
// the screen or color res. during the session
}
else
if( window.java ) // for N3, true if LiveConnect enabled
{
dtk = java.awt.Toolkit.getDefaultToolkit()
ss = dtk.getScreenSize()
W = ss.width
H = ss.height
N = Math.pow( 2, dtk.getColorModel().getPixelSize() )
// Notes:
// -returned values for screen res. are good even if
// user change it during the session. The value for
// color res. is the one that was set at the moment
// of Java's startup, even if changed later.
// -N3, with Java 1.0.2, always find 256 colors only.
// If N3's Java version can be upgraded, one could
// check the Java version to know if the value for
// color res. will be accurate or not.
// ver = java.lang.System.getProperty("java.version")
// return "1.0.2" (bad color) or "1.1.2" (good color)
// or perhaps other subversions
}
else // N2, E3, N3 w/Java off, probably E4, Opera and WebTV
{
W = H = N = "?"
// Notes:
// -E4 has probably his own methods to get the values,
// if it doesn't support the screen object, could be
// detected/added in a block before this one
}
// document.write("Screen is "+W+"×"+H+" with "+N+" colors.")
top.moveTo(0,0);
top.resizeTo(W,H-29);
//--></SCRIPT>
depending on the browser being used?
Can anyone help?
<SCRIPT LANGUAGE="javascript">
<!--
if(self.screen) { // true in N4
W = screen.width;
H = screen.height;
N = Math.pow( 2, screen.pixelDepth )
// Notes:
// -availWidth and availHeight returns screen size
// minus client interface's standard chromes.
// -pixelDepth isn't adapted for that purpose,
// returning the #bits for composing a palette
// -returned values are good even if user change
// the screen or color res. during the session
}
else
if( window.java ) // for N3, true if LiveConnect enabled
{
dtk = java.awt.Toolkit.getDefaultToolkit()
ss = dtk.getScreenSize()
W = ss.width
H = ss.height
N = Math.pow( 2, dtk.getColorModel().getPixelSize() )
// Notes:
// -returned values for screen res. are good even if
// user change it during the session. The value for
// color res. is the one that was set at the moment
// of Java's startup, even if changed later.
// -N3, with Java 1.0.2, always find 256 colors only.
// If N3's Java version can be upgraded, one could
// check the Java version to know if the value for
// color res. will be accurate or not.
// ver = java.lang.System.getProperty("java.version")
// return "1.0.2" (bad color) or "1.1.2" (good color)
// or perhaps other subversions
}
else // N2, E3, N3 w/Java off, probably E4, Opera and WebTV
{
W = H = N = "?"
// Notes:
// -E4 has probably his own methods to get the values,
// if it doesn't support the screen object, could be
// detected/added in a block before this one
}
// document.write("Screen is "+W+"×"+H+" with "+N+" colors.")
top.moveTo(0,0);
top.resizeTo(W,H-29);
//--></SCRIPT>