From 2fa336b945ce448c1cec160aa4968759ed4d0f46 Mon Sep 17 00:00:00 2001 From: James Tsay Date: Thu, 31 Oct 2024 15:34:55 -0700 Subject: [PATCH] Add hero-marquee --- acrobat/scripts/scripts.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/acrobat/scripts/scripts.js b/acrobat/scripts/scripts.js index 34b752cf..cede46ba 100644 --- a/acrobat/scripts/scripts.js +++ b/acrobat/scripts/scripts.js @@ -354,11 +354,12 @@ replaceDotMedia(document); // Default to loading the first image as eager. (async function loadLCPImage() { - const marquee = document.querySelector('.marquee'); // first marquee only + const blocks = '.marquee,.hero-marquee'; + const marquee = document.querySelector(blocks); // first marquee only if (marquee) { const index = window.browser.isMobile ? 1 : 3; - const selectorBG = `.marquee > div:nth-child(1) > div:nth-of-type(${index}) img`; - const selectorFG = '.marquee > div:nth-child(2) img'; + const selectorBG = `${blocks} > div:nth-child(1) > div:nth-of-type(${index}) img`; + const selectorFG = `${blocks} > div:nth-child(2) img`; marquee.querySelector(selectorBG)?.setAttribute('loading', 'eager'); marquee.querySelector(selectorFG)?.setAttribute('loading', 'eager'); }