Initial
This commit is contained in:
24
components/utils.jsx
Normal file
24
components/utils.jsx
Normal file
@@ -0,0 +1,24 @@
|
||||
export function getWidth() {
|
||||
if (typeof window != "undefined") {
|
||||
return Math.max(
|
||||
document.body.scrollWidth,
|
||||
document.documentElement.scrollWidth,
|
||||
document.body.offsetWidth,
|
||||
document.documentElement.offsetWidth,
|
||||
document.documentElement.clientWidth
|
||||
);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
export function getHeight() {
|
||||
if (typeof window != "undefined") {
|
||||
return Math.max(
|
||||
document.body.scrollHeight,
|
||||
document.documentElement.scrollHeight,
|
||||
document.body.offsetHeight,
|
||||
document.documentElement.offsetHeight,
|
||||
document.documentElement.clientHeight
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user