Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: RE: FLASH: (OT) screensize detection
From: Eric Dunham
Date: Thu, 18 Nov 1999 00:00:33 GMT

Here's the sample HTML for a very basic page...manipulate as you see fit...
<html>
<head>
<script language="JavaScript">
if (document.layers){
var screenW = window.innerWidth;
var screenH = window.innerHeight;
}
</script>
<body onLoad="alert(screenW); alert(screenH);">
<script>
if (document.all) { screenW = document.body.offsetWidth; screenH =
document.body.offsetHeight; }
</script>
</body>
</html>

For whatever reason, Netscape browsers get the screen size before the body
and styles have been declared in the document, and IE will only get the
screen size after the body has been declared (but not necessarily loaded).

Since "document.layers" is an element that is unique to Netscape, we can use
that in the head script section to find the height and width.
And since "document.all" is an element that is unique to Internet Explorer,
etc etc.

Other things that you might want to think about when using these elements in
terms of positioning is the fact that Netscape will break style upon
resizing the browser window :( an easy fix is just to put
onResize="this.location = this.location" in the body tag (or any other
reloading function will do.

If you need more explanation please mail me off list: brokenatblackhat [dot] net
-Eric Dunham

-----Original Message-----
From: owneratchinwag [dot] com [owneratchinwag [dot] com]On">mailto:owneratchinwag [dot] com]On Behalf Of Angeline
Geronimo
Sent: Wednesday, November 17, 1999 2:51 PM
To: 'flasheratchinwag [dot] com'
Subject: FLASH: (OT) screensize detection


Hello again everyone,

This is off topic but since we're mostly web designers then I figured at
least one of you can help me out with this. I need to know where to find the
javascript that would detect what screen resolution the visitor would have
so that I can direct them to the right webpage. Is there such a thing or
does anyone have a better idea? Thanks!

Angie


flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Streaming Media WEST '99 Conference & Exhibition
"The Worlds largest Internet Audio & Video Event"
December 7 - 9, San Jose Convention Center, California

Reserve your space today at http://www.streamingmedia.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com



flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Streaming Media WEST '99 Conference & Exhibition
"The Worlds largest Internet Audio & Video Event"
December 7 - 9, San Jose Convention Center, California

Reserve your space today at http://www.streamingmedia.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: (OT) screensize detection, Angeline Geronimo

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]