Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh onresize problem

Status
Not open for further replies.

belocin

Programmer
Jul 10, 2000
12
US
I have a menu that is dynamically positioned. The problem is when the user resizes the browser, I want the page to reload so the menu moves accordingly. It's not refreshing automatically, and what I tried doesn't work, can someone tell me what I'm doing wrong?

This is what I tried:

<script language=&quot;JavaScript&quot;>
function testresize()
{
if (onresize)
{ window.location.reload(); }
}
</script>
</head>
<body onload=&quot;testresize(); &quot;>
 
I ususally use a slightly different technique.
in the javascript section in th ehead of the doc I place the following:
Code:
window.onResize = reloadIt;
function reloadIt() {
	document.location = document.location;
}

HTH --------------------------------------------------
Goals are dreams with deadlines
 
I think this code would also work pretty nicely:
Code:
if (document.layers)
 onresize=document.close;

It closes the document when the page is resized. Closing the document forces it to be rerendered.
bluebrain.gif
blueuniment.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top