HighDots Forums  

Match Length with CSS and JavaScript

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Match Length with CSS and JavaScript in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
thom@tlanet.net
 
Posts: n/a

Default Match Length with CSS and JavaScript - 09-21-2007 , 03:54 PM






Two samples are provided for this isse ...

tlanet.net/1.html - attempt to match heights with CSS
tlanet.net/2.html - match height with CSS and JavaScript

The second example correctly calulates the size of a Div to match another
Div that varies from page to page.

This solution works in Internet Explorer and Opera but not Firefox and
Netscape.

Can you tell me why?

Thanks.,

.... Thom

Reply With Quote
  #2  
Old   
Joshua Cranmer
 
Posts: n/a

Default Re: Match Length with CSS and JavaScript - 09-21-2007 , 08:16 PM






thom (AT) tlanet (DOT) net wrote:
Quote:
Two samples are provided for this isse ...

tlanet.net/1.html - attempt to match heights with CSS
tlanet.net/2.html - match height with CSS and JavaScript

The second example correctly calulates the size of a Div to match another
Div that varies from page to page.

This solution works in Internet Explorer and Opera but not Firefox and
Netscape.

Can you tell me why?

Thanks.,

... Thom
Testing your JavaScript revealed that you are setting {element}.height =
128, which is incorrect JavaScript.

Try changing it to {element}.height = {value}+"px" and see how that line
of code works.

It also appears that the height you end up setting to the element via
JavaScript is not what you want it to be...

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth


Reply With Quote
  #3  
Old   
thom@tlanet.net
 
Posts: n/a

Default Re: Match Length with CSS and JavaScript - 09-21-2007 , 10:27 PM



Yes ... I discovered that in parallel to your reply ...

IE and Opera accept it with or without the "px"
Firefox and Netscape require that the "px" be present.

Thank you for the help.

.... Thom

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.