5
5
< meta http-equiv ="Content-Type " content ="text/html; charset=utf-8 " />
6
6
< title > Lazy load - fullPage.js</ title >
7
7
< 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 . " />
9
9
< meta name ="keywords " content ="fullpage,jquery,demo,screen,fullscreen,lazyload,lazy,passive,load,src,data-src,media " />
10
10
< meta name ="Resource-type " content ="Document " />
11
11
12
-
13
12
< link rel ="stylesheet " type ="text/css " href ="../dist/fullpage.css " />
14
13
< link rel ="stylesheet " type ="text/css " href ="examples.css " />
15
14
< style >
@@ -126,10 +125,22 @@ <h1>Lazy load</h1>
126
125
< p > Just use `data-src` or `data-srcset` for media elements.</ p >
127
126
</ div >
128
127
</ 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 ">
130
141
< div class ="slide " id ="slide1 ">
131
142
< div class ="intro ">
132
- < h1 > Lazy load image </ h1 >
143
+ < h1 > Section 4 </ h1 >
133
144
< img data-src ="imgs/iphone-blue.png " alt ="iphone " id ="iphone-two " />
134
145
</ div >
135
146
</ div >
@@ -145,7 +156,7 @@ <h1>Lazy load video</h1>
145
156
</ div >
146
157
147
158
</ div >
148
- < div class ="section " id ="section2 ">
159
+ < div class ="section " id ="section5 ">
149
160
< div class ="intro ">
150
161
< h1 > Lazy load background </ h1 >
151
162
< p > Make use of the `onLeave` callback. See the source code here!</ p >
@@ -158,14 +169,23 @@ <h1>Lazy load background </h1>
158
169
159
170
< script type ="text/javascript ">
160
171
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
164
178
onLeave : function ( origin , destination , direction ) {
165
179
if ( destination . index === 2 ) {
166
180
destination . item . classList . add ( 'load-background' ) ;
167
181
}
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
169
189
} ) ;
170
190
</ script >
171
191
0 commit comments