Skip to content

Commit 6f4705c

Browse files
committed
- Enhancement: improving lazyLoad example with lazyLoadThreshold
1 parent ba12d97 commit 6f4705c

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

examples/lazy-load.html

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
66
<title>Lazy load - fullPage.js</title>
77
<meta name="author" content="Alvaro Trigo Lopez" />
8-
<meta name="description" content="fullPage full-screen normal scrolling with autoScrolling." />
8+
<meta name="description" content="fullPage Lazy Load Demo." />
99
<meta name="keywords" content="fullpage,jquery,demo,screen,fullscreen,lazyload,lazy,passive,load,src,data-src,media" />
1010
<meta name="Resource-type" content="Document" />
1111

12-
1312
<link rel="stylesheet" type="text/css" href="../dist/fullpage.css" />
1413
<link rel="stylesheet" type="text/css" href="examples.css" />
1514
<style>
@@ -126,10 +125,22 @@ <h1>Lazy load</h1>
126125
<p>Just use `data-src` or `data-srcset` for media elements.</p>
127126
</div>
128127
</div>
129-
<div class="section" id="section1">
128+
<div class="section "id="section1">
129+
<div class="intro">
130+
<img data-srcset="imgs/2.png, imgs/2.png" alt="1"/>
131+
<h1>Section 2</h1>
132+
</div>
133+
</div>
134+
<div class="section active" id="section2">
135+
<div class="intro">
136+
<img data-srcset="imgs/3.png, imgs/2.png" alt="1"/>
137+
<h1>Section 3</h1>
138+
</div>
139+
</div>
140+
<div class="section" id="section4">
130141
<div class="slide" id="slide1">
131142
<div class="intro">
132-
<h1>Lazy load image</h1>
143+
<h1>Section 4</h1>
133144
<img data-src="imgs/iphone-blue.png" alt="iphone" id="iphone-two" />
134145
</div>
135146
</div>
@@ -145,7 +156,7 @@ <h1>Lazy load video</h1>
145156
</div>
146157

147158
</div>
148-
<div class="section" id="section2">
159+
<div class="section" id="section5">
149160
<div class="intro">
150161
<h1>Lazy load background </h1>
151162
<p>Make use of the `onLeave` callback. See the source code here!</p>
@@ -158,14 +169,23 @@ <h1>Lazy load background </h1>
158169

159170
<script type="text/javascript">
160171
var myFullpage = new fullpage('#fullpage', {
161-
menu: '#menu',
162-
anchors: ['firstPage', 'secondPage', '3rdPage'],
163-
sectionsColor: ['#C63D0F', '#1BBC9B', '#7E8F7C'],
172+
173+
// Lazyload default values
174+
lazyLoading: true,
175+
lazyLoadThreshold: 3,
176+
177+
// To lazy load a background
164178
onLeave: function(origin, destination, direction){
165179
if(destination.index === 2){
166180
destination.item.classList.add('load-background');
167181
}
168-
}
182+
},
183+
184+
// Optional
185+
menu: '#menu',
186+
anchors: ['firstPage', 'secondPage', '3rdPage', '4page', '5page', '6page', '7page'],
187+
sectionsColor: ['#C63D0F', '#1BBC9B', '#7E8F7C','#C63D0F', '#1BBC9B', '#7E8F7C','#C63D0F', '#1BBC9B', '#7E8F7C'],
188+
navigation: true
169189
});
170190
</script>
171191

0 commit comments

Comments
 (0)