DEV: De-jQuerify is-element-in-viewport (#17000)
This commit is contained in:
parent
43346ddaa6
commit
210d9c2b8f
|
@ -3,13 +3,12 @@ export default function (element) {
|
|||
return;
|
||||
}
|
||||
|
||||
const $window = $(window),
|
||||
rect = element.getBoundingClientRect();
|
||||
const rect = element.getBoundingClientRect();
|
||||
|
||||
return (
|
||||
rect.top >= 0 &&
|
||||
rect.left >= 0 &&
|
||||
rect.bottom <= $window.height() &&
|
||||
rect.right <= $window.width()
|
||||
rect.bottom <= window.innerHeight &&
|
||||
rect.right <= window.innerWidth
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue