Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 26th, 2006, 05:51 PM
Soteriologist Soteriologist is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 19 Soteriologist User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 33 m 4 sec
Reputation Power: 0
Refresh/Reload Problem

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.

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > Refresh/Reload Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT