-
Notifications
You must be signed in to change notification settings - Fork 7.3k
/
Copy pathlazy-load.html
193 lines (173 loc) · 7.43 KB
/
lazy-load.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Lazy load - fullPage.js</title>
<meta name="author" content="Alvaro Trigo Lopez" />
<meta name="description" content="fullPage Lazy Load Demo." />
<meta name="keywords" content="fullpage,jquery,demo,screen,fullscreen,lazyload,lazy,passive,load,src,data-src,media" />
<meta name="Resource-type" content="Document" />
<link rel="stylesheet" type="text/css" href="../dist/fullpage.css" />
<link rel="stylesheet" type="text/css" href="examples.css" />
<style>
/* Style for our header texts
* --------------------------------------- */
h1{
font-size: 5em;
font-family: arial,helvetica;
color: #fff;
margin:0;
}
.intro p{
color: #fff;
}
/* Centered texts in each section
* --------------------------------------- */
.section{
text-align:center;
}
/* Bottom menu
* --------------------------------------- */
#infoMenu li a {
color: #fff;
}
/* Lazy loading background
* --------------------------------------- */
#section2.load-background{
background-image: url(imgs/bg2.jpg);
background-size: cover;
}
</style>
<!--[if IE]>
<script type="text/javascript">
var console = { log: function() {} };
</script>
<![endif]-->
</head>
<body>
<select id="demosMenu">
<option selected>Choose Demo</option>
<option id="simple">Simple</option>
<option id="custom-arrows">Custom arrows</option>
<option id="hide-sections">Hide sections</option>
<option id="scroll-after-fullpage">Scroll after fullpage</option>
<option id="observer">Observer</option>
<option id="jquery-adapter">jQuery adapter</option>
<option id="active-slide">Active section and slide</option>
<option id="auto-height">Auto height</option>
<option id="autoplay-video-and-audio">Autoplay Video and Audio</option>
<option id="backgrounds">Background images</option>
<option id="backgrounds-fixed">Fixed fullscreen backgrounds</option>
<option id="background-video">Background video</option>
<option id="callbacks">Callbacks</option>
<option id="continuous-horizontal">Continuous horizontal (premium)</option>
<option id="continuous-vertical">Continuous vertical</option>
<option id="parallax">Parallax (premium)</option>
<option id="cards">Cards 3d (premium)</option>
<option id="water-effect">Water effect (premium)</option>
<option id="drop-effect">Drop effect (premium)</option>
<option id="css3">CSS3</option>
<option id="drag-and-move">Drag And Move (premium)</option>
<option id="easing-css3">Easing CSS</option>
<option id="easing-js">Easing JS</option>
<option id="fading-effect">Fading Effect (premium)</option>
<option id="fixed-headers">Fixed headers</option>
<option id="gradient-backgrounds">Gradient backgrounds</option>
<option id="interlocked-slides">Interlocked Slides (premium)</option>
<option id="looping">Looping</option>
<option id="methods">Methods</option>
<option id="navigation-vertical">Vertical navigation dots</option>
<option id="navigation-horizontal">Horizontal navigation dots</option>
<option id="navigation-tooltips">Navigation tooltips</option>
<option id="no-anchor">No anchor links</option>
<option id="normal-scroll">Normal scrolling</option>
<option id="normalScrollElements">Normal scroll elements</option>
<option id="offset-sections">Offset sections (premium)</option>
<option id="one-section">One single section</option>
<option id="reset-sliders">Reset sliders (premium)</option>
<option id="responsive-auto-height">Responsive Auto Height</option>
<option id="responsive-height">Responsive Height</option>
<option id="responsive-width">Responsive Width</option>
<option id="responsive-slides">Responsive Slides (premium)</option>
<option id="scrollBar">Scroll bar enabled</option>
<option id="scroll-horizontally">Scroll horizontally (premium)</option>
<option id="scrollOverflow">Scroll inside sections and slides</option>
<option id="scrollOverflow-reset">ScrollOverflow Reset (premium)</option>
<option id="lazy-load">Lazy load</option>
<option id="scrolling-speed">Scrolling speed</option>
<option id="trigger-animations">Trigger animations</option>
<option id="vue-fullpage">Vue component</option>
<option id="react-fullpage">React component</option>
<option id="angular-fullpage">Angular component</option>
</select>
<ul id="menu">
<li data-menuanchor="firstPage" class="active"><a href="#firstPage">First slide</a></li>
<li data-menuanchor="secondPage"><a href="#secondPage">Second slide</a></li>
<li data-menuanchor="3rdPage"><a href="#3rdPage">Third slide</a></li>
</ul>
<div id="fullpage">
<div class="section " id="section0">
<div class="intro">
<img data-srcset="imgs/1.png, imgs/2.png" alt="1"/>
<h1>Lazy load</h1>
<p>Just use `data-src` or `data-srcset` for media elements.</p>
</div>
</div>
<div class="section "id="section1">
<div class="intro">
<img data-srcset="imgs/2.png, imgs/2.png" alt="1"/>
<h1>Section 2</h1>
</div>
</div>
<div class="section active" id="section2">
<div class="intro">
<img data-srcset="imgs/3.png, imgs/2.png" alt="1"/>
<h1>Section 3</h1>
</div>
</div>
<div class="section" id="section4">
<div class="slide" id="slide1">
<div class="intro">
<h1>Section 4</h1>
<img data-src="imgs/iphone-blue.png" alt="iphone" id="iphone-two" />
</div>
</div>
<div class="slide" id="slide2">
<div>
<h1>Lazy load video</h1>
<video loop muted controls="false" data-autoplay>
<source data-src="http://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
<source data-src="http://www.w3schools.com/html/mov_bbb.ogg" type="video/ogg">
</video>
</div>
</div>
</div>
<div class="section" id="section5">
<div class="intro">
<h1>Lazy load background </h1>
<p>Make use of the `onLeave` callback. See the source code here!</p>
</div>
</div>
</div>
<script type="text/javascript" src="../dist/fullpage.js"></script>
<script type="text/javascript" src="examples.js"></script>
<script type="text/javascript">
var myFullpage = new fullpage('#fullpage', {
// Lazyload default values
lazyLoading: true,
lazyLoadThreshold: 3,
// To lazy load a background
onLeave: function(origin, destination, direction){
if(destination.index === 2){
destination.item.classList.add('load-background');
}
},
// Optional
menu: '#menu',
anchors: ['firstPage', 'secondPage', '3rdPage', '4page', '5page', '6page', '7page'],
sectionsColor: ['#C63D0F', '#1BBC9B', '#7E8F7C','#C63D0F', '#1BBC9B', '#7E8F7C','#C63D0F', '#1BBC9B', '#7E8F7C'],
navigation: true
});
</script>
</body>
</html>