Rework lazy loading as js controlled fetches
This commit is contained in:
@@ -88,7 +88,7 @@ class Output
|
||||
$caption = $label;
|
||||
}
|
||||
|
||||
// Build thumbnail URL - rely on native loading="lazy" for deferred loading
|
||||
// Build thumbnail URL - JavaScript will load via fetch() for cancellability
|
||||
$thumbUrl = $this->withQueryParams($url, [
|
||||
'thumb' => 1,
|
||||
'w' => $genThumbW,
|
||||
@@ -107,12 +107,10 @@ class Output
|
||||
. '>';
|
||||
$renderer->doc .= '<img'
|
||||
. ' class="luxtools-thumb"'
|
||||
. ' src="' . $thumbSrc . '"'
|
||||
. ' data-src="' . $thumbSrc . '"'
|
||||
. ' alt=""'
|
||||
. ' width="' . $thumbW . '"'
|
||||
. ' height="' . $thumbH . '"'
|
||||
. ' loading="lazy"'
|
||||
. ' decoding="async"'
|
||||
. ' />';
|
||||
$renderer->doc .= '<span class="luxtools-gallery-caption">' . $caption . '</span>';
|
||||
$renderer->doc .= '</a>';
|
||||
|
||||
Reference in New Issue
Block a user