Closed Thread Icon

Topic awaiting preservation: detecting screen width? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=9010" title="Pages that link to Topic awaiting preservation: detecting screen width? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: detecting screen width? <span class="small">(Page 1 of 1)</span>\

 
protoculture
Nervous Wreck (II) Inmate

From:
Insane since: Oct 2003

posted posted 02-06-2004 10:56

I need to detect the available screen width of the browser for IE. How can this be done?

I will also need to do it for netscape as well, later on.

www.mp3.com/protoculture

hyperbole
Paranoid (IV) Inmate

From: Madison, Indiana, USA
Insane since: Aug 2000

posted posted 02-06-2004 18:40

sorry. double post.


[This message has been edited by hyperbole (edited 02-06-2004).]

hyperbole
Paranoid (IV) Inmate

From: Madison, Indiana, USA
Insane since: Aug 2000

posted posted 02-06-2004 18:44

To get the size of the available drawing area

code:
if  (typeof(window.innerWidth) == 'number')                           use window.innerWidth
if (typeof(window.document.body.clientWidth) == 'number') use window.document.body.clientWidth



To get the window width

code:
if  (typeof(window.outerWidth) == 'number')                           use window.outerWidth
if (typeof(window.document.body.clientWidth) == 'number') use window.document.body.clientWidth



To get the screen width
use window.screen.width


-- not necessarily stoned... just beautiful.

protoculture
Nervous Wreck (II) Inmate

From:
Insane since: Oct 2003

posted posted 02-06-2004 23:29

that just gives me "undefined" in IE.

alert(window.innerWidth);
alert(window.document.body.clientWidth);

www.mp3.com/protoculture

[This message has been edited by protoculture (edited 02-06-2004).]

« BackwardsOnwards »

Show Forum Drop Down Menu