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

Q1557 How do I have the browser window center itself on screen regardless of screen resolution?

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

Try:

<body onLoad="
if (document.all) { w = document.body.clientWidth; h = document.body.clientHeight; }
else if (document.layers) { w = window.innerWidth; h = window.innerHeight; }
if (window.moveTo) window.moveTo(w/2,h/2)">

Feedback on 'Q1557 How do I have the browser window center itself on screen regardless of screen resolution?'

©2018 Martin Webb