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?