Welcome to WebmasterWorld Guest from 50.19.53.104

Forum Moderators: open

Message Too Old, No Replies

Resize one layer height to another in IE 6.0 browser

     

teelions

3:34 am on Jan 19, 2007 (gmt 0)

5+ Year Member



I have 2 pages: an asp content page that has a html (toc.html) include set within. The text of the asp page is inside a layer named "wrapper". And toc.html is a menu page with links inside a layer named "navcontainer".

The include file within the asp page is placed inside a layer named "toc".

I want the include to dynamically resize to the differing height of the "wrapper" layer on each page.

I cannot write in JavaScript from scratch but do understand alot. I found this script, modified it and gave it a try (on both pages, separately), but it didn't work:
------------------------------------------
<script language="JavaScript">
function tocHeight() {
if(document.getElementById &&!(document.all)) {
h = document.getElementById('wrapper').contentDocument.body.scrollHeight;
document.getElementById('navcontainer').style.height = h;
}
else if(document.all) {
h = document.window('wrapper').document.body.scrollHeight;
document.all.navcontainer.style.height = h;
}
}
</script>

<body onload='tocHeight();'>
------------------------------------------

I substituted pixelHeight for scrollHeight in the javascript but it still didn't work. Then I substituted "navcontainer" for "toc" in the javascript and that didn't work.

Any suggestions?

mehh

1:36 pm on Jan 20, 2007 (gmt 0)

5+ Year Member



try this:

<script type="text/JavaScript">
function tocHeight() {
if(document.getElementById) {
h = document.getElementById('wrapper').offsetHeight;
document.getElementById('navcontainer').style.height = h+"px";
}
else if(document.all) {
h = document.window('wrapper').offsetHeight;
document.all.navcontainer.style.height = h+"px";
}
}
</script>

teelions

5:17 pm on Jan 20, 2007 (gmt 0)

5+ Year Member



This didn't work. I tried it on both pages. Thanks for trying.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month