From 7f1b1383047cf139ce3ce6236e553e48f8ea7589 Mon Sep 17 00:00:00 2001 From: ray Date: Thu, 21 May 2020 16:17:19 +0100 Subject: [PATCH] add check for intersectionObserver support --- src/js/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/index.js b/src/js/index.js index 59c5909..71df099 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -1,5 +1,9 @@ (function() { window.addEventListener('DOMContentLoaded', event => { + if (!!window.IntersectionObserver) { + document.body.classList.add('supports-intersect'); + } + function onScreenHandler(entries) { entries.forEach(entry => { if (entry.intersectionRatio > 0) {