How to Get the Browser Viewport Dimensions?
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...
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:
18 Answers
Must Read
Cross-browser @media (width) and @media (height) values
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0)
const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0)