forked from felippepuhle/aero-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs_media.html
315 lines (270 loc) · 11.7 KB
/
js_media.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
---
layout: admin
title: Javascript - Media
section: js
module: js_media
header:
icon: lightbulb_outline
title: Media
description: Media components include things that have to do with large media objects like Images, Video, Audio, etc.
stylesheets:
- css/pages/js_media.css
javascripts:
- js/pages/js_media.js
---
<section id="js_media">
<!-- ############ -->
<!-- Material Box -->
<!-- ############ -->
<div class="row">
<div class="col s12">
<h4 class="main-text lighten-1">Material Box</h4>
<p class="caption">Material box is a material design implementation of the Lightbox plugin. When a user clicks on an image that can be enlarged. Material box centers the image and enlarges it in a smooth, non-jarring manner. To dismiss the image, the user can either click on the image again, scroll away, or press the ESC key.</p>
<img class="materialboxed responsive-img" width="650" src="img/sample-1.jpg">
<p>Creating the above image with the effect is as simple as adding a <code class="language-markup">materialboxed</code> class to the image tag.</p>
<pre>
<code class="language-markup">
<img class="materialboxed" width="650" src="img/sample-1.jpg">
</code>
</pre>
<h5 class="margin-top-35">Initialization</h5>
<p>Materialbox is intialized automatically. However, if you add images dynamically, you will have to add this initialization code.</p>
<pre>
<code class="language-javascript">
$(document).ready(function(){
$('.materialboxed').materialbox();
});
</code>
</pre>
<h5 class="margin-top-35">Captions</h5>
<p>It is very easy to add a short caption to your photo. Just add the caption as a <code class="language-markup">data-caption</code> attribute.</p>
<img class="materialboxed" data-caption="A picture of some deer and tons of trees" width="250" src="http://th01.deviantart.net/fs70/PRE/i/2013/126/1/e/nature_portrait_by_pw_fotografie-d63tx0n.jpg">
<pre>
<code class="language-markup">
<img class="materialboxed" data-caption="A picture of some deer and tons of trees" width="250" src="http://th01.deviantart.net/fs70/PRE/i/2013/126/1/e/nature_portrait_by_pw_fotografie-d63tx0n.jpg">
</code>
</pre>
</div>
</div>
<!-- ###### -->
<!-- Slider -->
<!-- ###### -->
<div class="row">
<div class="col s12">
<h4 class="main-text lighten-1">Slider</h4>
<p class="caption">Our slider is a simple and elegant image carousel. You can also have captions that will be transitioned on their own depending on their alignment. You can also have indicators that show up on the bottom of the slider. </p>
<p>Note: This is also Hammer.js compatible! Try swiping with your finger to scroll through the slider.</p>
<div class="slider">
<ul class="slides">
<li>
<img src="http://lorempixel.com/580/250/nature/1"> <!-- random image -->
<div class="caption center-align">
<h3>This is our big Tagline!</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
<li>
<img src="http://lorempixel.com/580/250/nature/2"> <!-- random image -->
<div class="caption left-align">
<h3>Left Aligned Caption</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
<li>
<img src="http://lorempixel.com/580/250/nature/3"> <!-- random image -->
<div class="caption right-align">
<h3>Right Aligned Caption</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
<li>
<img src="http://lorempixel.com/580/250/nature/4"> <!-- random image -->
<div class="caption center-align">
<h3>This is our big Tagline!</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
</ul>
</div>
<pre>
<code class="language-markup">
<div class="slider">
<ul class="slides">
<li>
<img src="http://lorempixel.com/580/250/nature/1"> <!-- random image -->
<div class="caption center-align">
<h3>This is our big Tagline!</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
<li>
<img src="http://lorempixel.com/580/250/nature/2"> <!-- random image -->
<div class="caption left-align">
<h3>Left Aligned Caption</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
<li>
<img src="http://lorempixel.com/580/250/nature/3"> <!-- random image -->
<div class="caption right-align">
<h3>Right Aligned Caption</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
<li>
<img src="http://lorempixel.com/580/250/nature/4"> <!-- random image -->
<div class="caption center-align">
<h3>This is our big Tagline!</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
</ul>
</div>
</code>
</pre>
<h5 class="margin-top-35">Fullscreen Slider</h5>
<p>You can easliy make this slider a fullscreen slider by adding the class <code class="language-markup">fullscreen</code> to the slider div. Here's a quick demo.</p>
<a href="http://materializecss.com/fullscreen-slider-demo.html" target="_blank" class="btn-large waves-effect waves-light">Open Demo</a>
<h5 class="margin-top-35">jQuery Initialization</h5>
<pre>
<code class="language-javascript">
$(document).ready(function(){
$('.slider').slider({full_width: true});
});
</code>
</pre>
<h5 class="margin-top-35">jQuery Plugin Options</h5>
<table class="highlight">
<thead>
<tr>
<th>Option Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Indicators</td>
<td>Set to false to hide slide indicators. (Default: True)</td>
</tr>
<tr>
<td>Height</td>
<td>Set height of slider. (Default: 400)</td>
</tr>
<tr>
<td>Transition</td>
<td>Set the duration of the transition animation in ms. (Default: 500)</td>
</tr>
<tr>
<td>Interval</td>
<td>Set the duration between transitions in ms. (Default: 6000)</td>
</tr>
</tbody>
</table>
<h5 class="margin-top-35">jQuery Plugin Methods</h5>
<p>We have methods to pause, start, move to next and move to previous slide.</p>
<pre>
<code class="language-javascript">
// Pause slider
$('.slider').slider('pause');
// Start slider
$('.slider').slider('start');
// Next slide
$('.slider').slider('next');
// Previous slide
$('.slider').slider('prev');
</code>
</pre>
</div>
</div>
<!-- ######## -->
<!-- Carousel -->
<!-- ######## -->
<div class="row">
<div class="col s12">
<h4 class="main-text lighten-1">Carousel</h4>
<p class="caption">Our slider is a simple and elegant image carousel. You can also have captions that will be transitioned on their own depending on their alignment. You can also have indicators that show up on the bottom of the slider. </p>
<p>Note: This is also touch compatible! Try swiping with your finger to scroll through the carousel.</p>
<div class="carousel">
<a class="carousel-item" href="#one!"><img src="http://lorempixel.com/250/250/nature/1"></a>
<a class="carousel-item" href="#two!"><img src="http://lorempixel.com/250/250/nature/2"></a>
<a class="carousel-item" href="#three!"><img src="http://lorempixel.com/250/250/nature/3"></a>
<a class="carousel-item" href="#four!"><img src="http://lorempixel.com/250/250/nature/4"></a>
<a class="carousel-item" href="#five!"><img src="http://lorempixel.com/250/250/nature/5"></a>
</div>
<div class="carousel carousel-slider">
<a class="carousel-item" href="#one!"><img src="http://lorempixel.com/800/400/food/1"></a>
<a class="carousel-item" href="#two!"><img src="http://lorempixel.com/800/400/food/2"></a>
<a class="carousel-item" href="#three!"><img src="http://lorempixel.com/800/400/food/3"></a>
<a class="carousel-item" href="#four!"><img src="http://lorempixel.com/800/400/food/4"></a>
</div>
<pre>
<code class="language-markup">
<div class="carousel">
<a class="carousel-item" href="#one!"><img src="http://lorempixel.com/250/250/nature/1"></a>
<a class="carousel-item" href="#two!"><img src="http://lorempixel.com/250/250/nature/2"></a>
<a class="carousel-item" href="#three!"><img src="http://lorempixel.com/250/250/nature/3"></a>
<a class="carousel-item" href="#four!"><img src="http://lorempixel.com/250/250/nature/4"></a>
<a class="carousel-item" href="#five!"><img src="http://lorempixel.com/250/250/nature/5"></a>
</div>
<div class="carousel carousel-slider">
<a class="carousel-item" href="#one!"><img src="http://lorempixel.com/800/400/food/1"></a>
<a class="carousel-item" href="#two!"><img src="http://lorempixel.com/800/400/food/2"></a>
<a class="carousel-item" href="#three!"><img src="http://lorempixel.com/800/400/food/3"></a>
<a class="carousel-item" href="#four!"><img src="http://lorempixel.com/800/400/food/4"></a>
</div>
</code>
</pre>
<h5 class="margin-top-35">jQuery Initialization</h5>
<pre>
<code class="language-javascript">
$(document).ready(function(){
$('.carousel').carousel();
});
</code>
</pre>
<h5 class="margin-top-35">jQuery Plugin Options</h5>
<table class="highlight">
<thead>
<tr>
<th>Option Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>time_constant</td>
<td>Transition time. (Default: 200)</td>
</tr>
<tr>
<td>dist</td>
<td>Perspective zoom. If 0, all items are the same size. (Default: -100)</td>
</tr>
<tr>
<td>shift</td>
<td>Set the duration of the transition animation in ms. (Default: 500)</td>
</tr>
<tr>
<td>padding</td>
<td>Set the duration between transitions in ms. (Default: 6000)</td>
</tr>
<tr>
<td>full_width</td>
<td>Set the duration between transitions in ms. (Default: 6000)</td>
</tr>
</tbody>
</table>
<h5 class="margin-top-35">jQuery Plugin Methods</h5>
<p>We have methods to pause, start, move to next and move to previous slide.</p>
<pre>
<code class="language-javascript">
// Next slide
$('.carousel').carousel('next');
$('.carousel').carousel('next', [3]); // Move next n times.
// Previous slide
$('.carousel').carousel('prev');
$('.carousel').carousel('prev', [4]); // Move prev n times.
</code>
</pre>
</div>
</div>
</section>