Skip to content

Instantly share code, notes, and snippets.

@pcastelan
Forked from joshcarr/window-height-width.js
Created December 17, 2018 11:08
Show Gist options
  • Select an option

  • Save pcastelan/c9b64dda559eb49d17f63fb1b6cf1701 to your computer and use it in GitHub Desktop.

Select an option

Save pcastelan/c9b64dda559eb49d17f63fb1b6cf1701 to your computer and use it in GitHub Desktop.

Revisions

  1. @joshcarr joshcarr created this gist Jul 3, 2014.
    7 changes: 7 additions & 0 deletions window-height-width.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    // vanilla JS window width and height
    var w=window,
    d=document,
    e=d.documentElement,
    g=d.getElementsByTagName('body')[0],
    x=w.innerWidth||e.clientWidth||g.clientWidth,
    y=w.innerHeight||e.clientHeight||g.clientHeight;