-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
parallax.html
168 lines (158 loc) · 5.36 KB
/
parallax.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
<!DOCTYPE html>
<html lang="en">
<head>
{{> head }}
</head>
<body>
{{> navbar }}
<main>
{{> intro}}
<div class="container">
<div class="row">
<div class="col s12 m8 offset-m1 xl7 offset-xl1">
<!-- Parallax Section -->
<div id="introduction" class="scrollspy section">
<p class="caption">
Parallax is an effect where the background content or image in
this case, is moved at a different speed than the foreground
content while scrolling. Check out the demo to get a better idea
of it.
</p>
<a
href="parallax-demo.html"
target="_blank"
class="btn-large waves-effect waves-light"
>Open Demo</a
>
</div>
<pre><code class="language-markup">
<div class="parallax-container">
<div class="parallax"><img src="images/parallax1.jpg"></div>
</div>
</code></pre>
<div id="initialization" class="scrollspy section">
<h3 class="header">Initialization</h3>
<pre><code class="language-javascript">
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.parallax');
var instances = M.Parallax.init(elems, {
// specify options here
});
});
</code></pre>
</div>
<div id="options" class="section scrollspy">
<h3 class="header">Options</h3>
<table class="striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>responsiveThreshold</td>
<td>Number</td>
<td>0</td>
<td>
The minimum width of the screen, in pixels, where the
parallax functionality starts working.
</td>
</tr>
</tbody>
</table>
</div>
<div id="methods" class="scrollspy section">
<h3 class="header">Methods</h3>
<blockquote>
<p>
All the methods are called on the plugin instance. You can get
the plugin instance like this:
</p>
<pre><code class="language-javascript col s12">
var instance = M.Parallax.getInstance(elem);
</code></pre>
</blockquote>
<h5 class="method-header">
.destroy();
</h5>
<p>Destroy plugin instance and teardown</p>
<pre><code class="language-javascript col s12">
instance.destroy();
</code></pre>
</div>
<div id="properties" class="scrollspy section">
<h3 class="header">Properties</h3>
<table class="striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>el</td>
<td>Element</td>
<td>The DOM element the plugin was initialized with.</td>
</tr>
<tr>
<td>options</td>
<td>Object</td>
<td>The options the instance was initialized with.</td>
</tr>
</tbody>
</table>
</div>
<div id="customization" class="scrollspy section">
<h3 class="header">Parallax Customization</h3>
<p>
The parallax container height is what defines how much of the
image can be seen. This is set to a default of 500px. You can
add your own style to override this.
</p>
<pre><code class="language-css">
.parallax-container {
height: "your height here";
}
</code></pre>
</div>
</div>
<!-- Table of Contents -->
<div class="col hide-on-small-only m3 xl3">
<div class="toc-wrapper">
<div style="height: 1px;">
<ul class="section table-of-contents">
<li>
<a href="#introduction">Introduction</a>
</li>
<li>
<a href="#initialization">Initialization</a>
</li>
<li>
<a href="#options">Options</a>
</li>
<li>
<a href="#methods">Methods</a>
</li>
<li>
<a href="#properites">Properties</a>
</li>
<li>
<a href="#customization">Customization</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</main>
{{> footer }}
<script type="module" src="/src/main.ts"></script>
</body>
</html>