add check for intersectionObserver support
This commit is contained in:
parent
8a4503c925
commit
7f1b138304
|
@ -1,5 +1,9 @@
|
||||||
(function() {
|
(function() {
|
||||||
window.addEventListener('DOMContentLoaded', event => {
|
window.addEventListener('DOMContentLoaded', event => {
|
||||||
|
if (!!window.IntersectionObserver) {
|
||||||
|
document.body.classList.add('supports-intersect');
|
||||||
|
}
|
||||||
|
|
||||||
function onScreenHandler(entries) {
|
function onScreenHandler(entries) {
|
||||||
entries.forEach(entry => {
|
entries.forEach(entry => {
|
||||||
if (entry.intersectionRatio > 0) {
|
if (entry.intersectionRatio > 0) {
|
||||||
|
|
Loading…
Reference in New Issue