Skip to content

Instantly share code, notes, and snippets.

@manuelcanga
Created January 7, 2022 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manuelcanga/65fb8f1057f9ab90debf29dc4e26e211 to your computer and use it in GitHub Desktop.
Save manuelcanga/65fb8f1057f9ab90debf29dc4e26e211 to your computer and use it in GitHub Desktop.
get size of screen (js)
trasweb = trasweb | {};
trasweb.getSize = function () {
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;
return {"x": x, "y": y};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment