[WEB4LIB] Java coding help please

Justin Rounds jrounds at uchicago.edu
Mon Apr 4 12:14:51 EDT 2005


I think your problem might be with "document.body.clientWidth" -- 
according to my copy of "Dynamic HTML" (a couple of years old but still 
fairly accurate):

"In its effort to institute thie standards-compatible mode in IE 6 for 
Windows... Microsoft has rendered useless the old trick of using the 
body element's clientHeight and clientWidth properties to obtain the 
equivalent of Netscape's window.innerHeight and window.innerWidth 
properties. In standards-compatibility mode... you must use the html 
element's clientHeight and clientWidth properties to find these values. 
Use these effective reference shortcuts:
	document.body.parentNode.clientHeight
	document.body.parentNode.clientWidth"

Thus try using "document.body.parentNode.clientWidth" instead of 
"document.body.clientWidth".

Hope this helps!
_
j


Clinton Lowery wrote:
> Hi.
>  
> I'm having a coding problem when trying to resize a window for IE 
> 6.0.
> 
> What I'm trying to do is pull different style sheets for different 
> screen sizes. Instead of relying on percentages, which gets me close 
> but no cigar, I'm trying to pull, for example, an 800 width or a 1024 
> width depending on the window size. Since Firefox and IE have different 
> measures, I have to test for the value self.innerWidth to see which is 
> needed.
> 
> 
> I'm not sure if my browser is the problem - it may be - as I get "undefined" as a value for frameWidth for the browser I use at work.
> 
> 
> The function works for Firefox. It does not work for IE at 1024 
> resolution however, and I've only found the three measurements to check 
> by. Can anyone help?
> 
> Thanks.
> 
> Here's the operation:
> 
> var frameWidth;
> 
> if (self.innerWidth)
> { frameWidth = self.innerWidth; }
> else if (document.documentElement && 
> document.documentElement.clientWidth)
> { frameWidth = document.documentElement.clientWidth; }
> else if (document.body)
> { frameWidth = document.body.clientWidth; }
> 
> if ( frameWidth > 800 )
> { if ( self.innerWidth )
>     { document.write('<'+'link rel="stylesheet" type="text/css" 
> href="http://jpl.coj.net/resources/odr1024-test.css" />'); }
>     else 
>     { document.write('<'+'link rel="stylesheet" type="text/css" 
> href="http://jpl.coj.net/resources/odr1024ie-test.css" />'); }
> }
> 
> else 
> { if ( self.innerWidth )
>     { document.write('<'+'link rel="stylesheet" type="text/css" 
> href="http://jpl.coj.net/resources/odr800-test.css" />'); }
>     else 
>     { document.write('<'+'link rel="stylesheet" type="text/css" 
> href="http://jpl.coj.net/resources/odr800ie-test.css" />'); }
> }
> 
> 
> 
> 		
> ---------------------------------
> Do you Yahoo!?
>  Better first dates. More second dates. Yahoo! Personals 
> 
> 
> *********************************************************************
> Due to deletion of content types excluded from this list by policy,
> this multipart message was reduced to a single part, and from there
> to a plain text message.
> *********************************************************************
> 
> 

-- 
-------------------------------------------
Justin Rounds
Graphic Design and Digital Media Specialist
Digital Library Development Center
University of Chicago
1100 East 57th Street
Chicago, Illinois 60637
(773)702-4391
-------------------------------------------



More information about the Web4lib mailing list