diff --git a/scripts/scripts.js b/scripts/scripts.js index 01a8952..421452d 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -148,12 +148,17 @@ const eagerLoad = (img) => { }; (async function loadLCPImage() { - const marquee = document.querySelector('.marquee.split'); - if (marquee) { - marquee.querySelectorAll('img').forEach(eagerLoad); - } else { + const marquee = document.querySelector('.marquee'); + if (!marquee) { eagerLoad(document.querySelector('img')); + return; + } + + if (marquee.classList.contains('split')) { + marquee.querySelectorAll('img').forEach(eagerLoad); + return; } + eagerLoad(marquee.querySelector('img')); }()); /*