Skip to content

Instantly share code, notes, and snippets.

View mzibari's full-sized avatar


View GitHub Profile
mzibari / getViewportSize.js
Created March 14, 2020 01:55 — forked from scottjehl/getViewportSize.js
Reliably get viewport dimensions in JS
An experiment in getting accurate visible viewport dimensions across devices
(c) 2012 Scott Jehl.
MIT/GPLv2 Licence
function viewportSize(){
var test = document.createElement( "div" ); = "position: fixed;top: 0;left: 0;bottom: 0;right: 0;";