Skip to content

Commit

Permalink
Merge pull request #168 from adobecom/auniverseaway-patch-7
Browse files Browse the repository at this point in the history
MWPW-141663 - Fix BACOM Homepage Marquee LCP
  • Loading branch information
auniverseaway authored Jan 25, 2024
2 parents 92ee717 + ab0a7ee commit 3c52072
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}());

/*
Expand Down

0 comments on commit 3c52072

Please sign in to comment.