Skip to content

Instantly share code, notes, and snippets.

@jeangontijo
Last active June 20, 2018 19:36
Show Gist options
  • Save jeangontijo/90189a531c80e105c3f537b29262e5ea to your computer and use it in GitHub Desktop.
Save jeangontijo/90189a531c80e105c3f537b29262e5ea to your computer and use it in GitHub Desktop.
Set Viewport onResize Function
var ww;
var wh;
var setViewport = function () {
ww = window.innerWidth || document.documentElement.clientWidth;
wh = window.innerHeight || document.documentElement.clientHeight;
}
setViewport();
window.addEventListener('resize', function () {
setViewport();
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment