|
Q1625 How can I cause a page to refresh/reload when a user changes the size of the window?
irt.org | Knowledge Base | JavaScript | Window | Q1625 [ previous next ]
Q1625 How can I cause a page to refresh/reload when a user changes the size of the window?
Try the following, the JavaScript1.2 is required:
<script language="JavaScript1.2"><!--
var origWidth, origHeight;
if (document.layers) {
origWidth = window.innerWidth;
origHeight = window.innerHeight;
onresize = function() { if(innerWidth != origWidth || innerHeight != origHeight) location.reload(); }
}
else if (document.all) onresize = function() { window.location.reload(); }
//--></script>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.