Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JavaScript cross-browser @media (width) and @media (height) values
// http://stackoverflow.com/questions/1248081/get-the-browser-viewport-dimensions-with-javascript
var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment