add check for intersectionObserver support

This commit is contained in:
Ray Elliott 2020-05-21 16:17:19 +01:00
parent 8a4503c925
commit 7f1b138304
1 changed files with 4 additions and 0 deletions

View File

@ -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) {