[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
values.

Do I have the syntax wrong?

Sam



-----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  =
window.screen.availHeight;
>   }
>}
>//-->
></script>
></head>
>
>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
script
in various versions of Explorer.

Move the writing of the availHeight outside the if
(input.createTextRange)
and it should work.

--------------------------------------------------
ppk, freelance web developer
Interaction, copywriting, JavaScript, integration
http://www.xs4all.nl/~ppk/
Column "Keep it Simple":
http://www.digital-web.com/columns/keepitsimple/
What shall we do with the W3C DOM?:
http://www.evolt.org/article/What_shall_we_do_with_the_W3C_DOM/4090/4731
1/index.html
--------------------------------------------------


_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail

--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

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