Forum Moderators: open
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?
<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>