[thelist] NS 7.0 ScreenSize Bug

Sam Carter sam at nativeintelligence.com
Thu Dec 5 14:01:00 CST 2002

Thanks for the feedback.  I deleted the IF altogether.  I should've
noticed it.

Here's another problem:
AvailHeight and AvailWidth seem to work fine, but they return downsized
window sizes.

I'd like the full width / height returned, but I have trouble getting
values from

>     document.LoginForm.strResWidth.value = window.screen.Width;
>     document.LoginForm.strResHeight.value  = window.screen.Height;

Which *I thought* returned the display values, not the window size

Do I have the syntax wrong?


-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org] On Behalf Of Peter-Paul Koch
Sent: Thursday, December 05, 2002 10:42 AM
To: thelist at lists.evolt.org
Subject: Re: [thelist] NS 7.0 ScreenSize Bug

>The script to capture screen resolution is the last two lines inserted
>in the setfocus procedure.  Values are saved in hidden input fields and
>PUT to the server with the form is submitted.
><script language="JavaScript">
>function setfocus (input) {
>   input.focus();
>   if (input.createTextRange) {
>     var range = input.createTextRange();
>     range.collapse(true);
>  range.expand("textedit");
>     range.select();
>     document.LoginForm.strResWidth.value = window.screen.availWidth;
>     document.LoginForm.strResHeight.value  =
>   }
>It's worked fine in every browser I tested, except Netscape 7.0.  It
>seems no values are stored for strResWidth or Height.

Mozilla doesn't support createTextRange. I assume you only tested the
in various versions of Explorer.

Move the writing of the availHeight outside the if
and it should work.

ppk, freelance web developer
Interaction, copywriting, JavaScript, integration
Column "Keep it Simple":
What shall we do with the W3C DOM?:

STOP MORE SPAM with the new MSN 8 and get 2 months FREE*

* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !

More information about the thelist mailing list