Skip to content

Commit

Permalink
feat: lazy load
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdarkle committed Nov 2, 2024
1 parent 1f3b0c9 commit 624b0ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions js/src/forum/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ app.initializers.add('darkle/fancybox', () => {
Dots: false,
infinite: false,
dragFree: false,
preload: 0,
});
});

Expand Down Expand Up @@ -51,6 +52,7 @@ app.initializers.add('darkle/fancybox', () => {
Fancybox.fromNodes(group, {
Carousel: {
infinite: false,
preload: 0,
},
Toolbar: {
display: {
Expand Down
4 changes: 2 additions & 2 deletions src/DefineGalleryTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __invoke(Configurator $config)
<xsl:choose>
<xsl:when test="parent::FANCYBOX-GALLERY-ITEM">
<a data-fancybox="gallery" href="{@src}">
<img src="{@src}" alt="{@alt}" loading="lazy"/>
<img data-lazy-src="{@src}" alt="{@alt}" loading="lazy"/>
</a>
</xsl:when>
<xsl:otherwise>
Expand All @@ -39,7 +39,7 @@ public function __invoke(Configurator $config)
<xsl:choose>
<xsl:when test="parent::FANCYBOX-GALLERY-ITEM">
<a data-fancybox="gallery" href="{@url}">
<img src="{@url}" alt="" loading="lazy"/>
<img data-lazy-src="{@url}" alt="" loading="lazy"/>
</a>
</xsl:when>
<xsl:otherwise>
Expand Down

0 comments on commit 624b0ae

Please # to comment.