You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
611 B
JavaScript
28 lines
611 B
JavaScript
6 years ago
|
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;
|
||
6 years ago
|
|
||
6 years ago
|
var dimensions = {
|
||
|
windowHeight: y,
|
||
|
windowWidth: x
|
||
|
};
|
||
|
return dimensions;
|
||
|
}
|
||
|
//--------------------------
|
||
|
// event handlers
|
||
|
//--------------------------
|
||
6 years ago
|
}
|
||
6 years ago
|
export default DOMUtils;
|