homepage Welcome to WebmasterWorld Guest from 54.167.249.155
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Resize one layer height to another in IE 6.0 browser
teelions




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

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




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

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




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved