code for increasing size of page

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>
 
S

Steve Easton

For one thing, it uses javascript **and** java virtual machine. Java virtual machine is not
installed on all computers.
You might try the free add in named Spawn from www.jimcoaddins.com
However, forcing a viewers browser to resize the screen is not really a good idea and will cause
most people to leave your site.
I know I will.
I have my browser "view port" set the way I want it and I do ***NOT*** want it changed.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
L

laura

I had no idea. The code was given to me to replace page margins or so I
thought. Thanks for responding. I won't be using it.
Laura
 
M

Murray

Good choice, Laura. Perhaps there is another way to accomplish what you
want. Can you tell me what you mean by "replace page margins"?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top