Skip to content

Instantly share code, notes, and snippets.

@garystorey
Created July 20, 2015 15:09
Show Gist options
  • Select an option

  • Save garystorey/2937ab00dc93f08afe6a to your computer and use it in GitHub Desktop.

Select an option

Save garystorey/2937ab00dc93f08afe6a to your computer and use it in GitHub Desktop.
browser Dimensions
function report() {
document.getElementsByTagName('output')[0].innerHTML = 'screen.width:'+screen.width+'<br>screen.height:'+screen.height+'<br>window.innerWidth:'+window.innerWidth+'<br>window.innerHeight:'+window.innerHeight+'<br>window.outerWidth:'+window.outerWidth+'<br>window.outerHeight:'+window.outerHeight+'<br>document.documentElement.<br> clientWidth:'+document.documentElement.clientWidth+'<br>document.documentElement.<br> clientHeight:'+document.documentElement.clientHeight+'<br>window.devicePixelRatio:'+window.devicePixelRatio; }
window.addEventListener('load', report, false);
window.addEventListener('resize', report, false);
window.addEventListener('orientationchange', report, false);
window.addEventListener('deviceorientation', report, false);
window.addEventListener('MozOrientation', report, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment