Skip to content

Commit 624b0ae

Browse files
committed
feat: lazy load
1 parent 1f3b0c9 commit 624b0ae

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

js/src/forum/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ app.initializers.add('darkle/fancybox', () => {
1919
Dots: false,
2020
infinite: false,
2121
dragFree: false,
22+
preload: 0,
2223
});
2324
});
2425

@@ -51,6 +52,7 @@ app.initializers.add('darkle/fancybox', () => {
5152
Fancybox.fromNodes(group, {
5253
Carousel: {
5354
infinite: false,
55+
preload: 0,
5456
},
5557
Toolbar: {
5658
display: {

src/DefineGalleryTemplate.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __invoke(Configurator $config)
2121
<xsl:choose>
2222
<xsl:when test="parent::FANCYBOX-GALLERY-ITEM">
2323
<a data-fancybox="gallery" href="{@src}">
24-
<img src="{@src}" alt="{@alt}" loading="lazy"/>
24+
<img data-lazy-src="{@src}" alt="{@alt}" loading="lazy"/>
2525
</a>
2626
</xsl:when>
2727
<xsl:otherwise>
@@ -39,7 +39,7 @@ public function __invoke(Configurator $config)
3939
<xsl:choose>
4040
<xsl:when test="parent::FANCYBOX-GALLERY-ITEM">
4141
<a data-fancybox="gallery" href="{@url}">
42-
<img src="{@url}" alt="" loading="lazy"/>
42+
<img data-lazy-src="{@url}" alt="" loading="lazy"/>
4343
</a>
4444
</xsl:when>
4545
<xsl:otherwise>

0 commit comments

Comments
 (0)