remove unused utils.js
This commit is contained in:
parent
55baf73dd6
commit
262d1d17c1
1 changed files with 0 additions and 14 deletions
|
|
@ -1,14 +0,0 @@
|
||||||
function isElementInView(elementID) {
|
|
||||||
const element = document.getElementById(elementID);
|
|
||||||
const rect = element.getBoundingClientRect();
|
|
||||||
const windowHeight =
|
|
||||||
window.innerHeight || document.documentElement.clientHeight;
|
|
||||||
const windowWidth =
|
|
||||||
window.innerWidth || document.documentElement.clientWidth;
|
|
||||||
|
|
||||||
// check if element is completely in view
|
|
||||||
const isInHorizontalView = rect.left >= 0 && rect.right <= windowWidth;
|
|
||||||
const isInVerticalView = rect.top >= 0 && rect.bottom <= windowHeight;
|
|
||||||
|
|
||||||
return isInHorizontalView && isInVerticalView;
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue