fipamo/brain/tools/utilities/DOMUtils.js

32 lines
741 B
JavaScript

class DOMUtils
{
//--------------------------
// constructor
//--------------------------
constructor()
{}
//--------------------------
// methods
//--------------------------
getWindowXY()
{
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;
var dimensions = {
windowHeight: y,
windowWidth: x
}
return dimensions;
}
//--------------------------
// event handlers
//--------------------------
}
export default DOMUtils