471,603 Members | 1,625 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

Match Length with CSS and JavaScript

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
Sep 21 '07 #1
2 1975
th**@tlanet.net wrote:
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
Sep 22 '07 #2
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
Sep 22 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by Ravi | last post: by
6 posts views Thread by Mark Findlay | last post: by
reply views Thread by hwait | last post: by
17 posts views Thread by Randy Webb | last post: by
9 posts views Thread by shellon | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.