Skip to content
This repository has been archived by the owner on Jul 11, 2021. It is now read-only.

Improve retrieval of width and height #26

Open
Faterou opened this issue Nov 14, 2016 · 0 comments
Open

Improve retrieval of width and height #26

Faterou opened this issue Nov 14, 2016 · 0 comments

Comments

@Faterou
Copy link
Contributor

Faterou commented Nov 14, 2016

Originally reported by: Francis Guérin (Bitbucket: Faterou, GitHub: Faterou)


We can follow this code to make sure it works with any browser.

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;

Taken from here


Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant