Ok, I've got a nav on my aspx page that's built from some views of sql tables. Now, this aspx page is viewed through a frame of a default/main html page.
I have a fixed width set to my treebox as it doesn't need to be adjusted width wise.
I have some javascript written to adjust the height of the treebox based off of the browser's set height.
On the body of my page I call my function from the onload AND an onresize events like this:
<body onload="resizeTree()" topmargin="0" leftmargin="0" bottommargin="0">
This is what my function looks like:
Code:
<script type="text/javascript">
<!--
function resizeTree()
{
var treeDiv = document.getElementById("NavTreeDiv");
var intCompensate = 26;
var documentObj = document.documentElement;
if (window.opera || (document.all && !(document.compatMode && document.compatMode == "CSS1Compat")))
{
documentObj = document.body;
}
treeDiv.style.height = (parseInt(documentObj.clientHeight) - intCompensate) + "px";
}
-->
</script>
This function works great with the onload event, but doesn't do anything with onresize. I have to refresh my page through the browser after I've adjusted the height of my broswer for the height of my treebox to get re-adjusted.
I've tried calling this (init) from onload but it does nothing:
Code:
function init()
{
setTimeout("window.onresize = reloadWindow", 1000);
}
function reloadWindow()
{
window.location.reload();
}
I've also tried initializing this (reloadWindow) through onload but it just causes my browser to get sent into an endless loop of refreshing:
Code:
function reloadWindow()
{
window.location.href = window.location.href
}
OR
Code:
function reloadWindow()
{
setTimeout("window.location.href = window.location.href", 1000);
}
I'm not sure what the dealio is??? I just want my height to either get adjust on resize, or to it just reload the page once on resize so that it will run my auto-adjust function and resize my height that way.