fipamo/brain/utils/tools/DOMUtils.js

28 lines
611 B
JavaScript
Raw Normal View History

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;
2018-10-31 17:00:31 +01:00
var dimensions = {
windowHeight: y,
windowWidth: x
};
return dimensions;
}
//--------------------------
// event handlers
//--------------------------
2018-10-31 17:00:31 +01:00
}
export default DOMUtils;