Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1625 How can I cause a page to refresh/reload when a user changes the size of the window?

You are here: irt.org | FAQ | JavaScript | Window | Q1625 [ previous next ]

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>

Feedback on 'Q1625 How can I cause a page to refresh/reload when a user changes the size of the window?'

©2018 Martin Webb