I want to provide my visitors the ability to see images in high quality, is there any way I can detect the window size?
Or better yet, the viewport size of the browser with JavaScript? See green area here:
https://i.stack.imgur.com/zYrB7.jpg
https://i.stack.imgur.com/zYrB7.jpg
http://dev.w3.org/csswg/mediaqueries/#height
http://dev.w3.org/csswg/mediaqueries/#height
var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
window.innerWidth and .innerHeight
document.documentElement.clientWidth and .clientHeight
Resources
http://stackoverflow.com/questions/1248081/get-the-browser-viewport-dimensions-with-javascript