forked from OwlCarousel2/OwlCarousel2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
775 lines (686 loc) · 19 KB
/
index.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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="msapplication-tap-highlight" content="no"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Owl Carousel 2.0.0-beta.1.8</title>
<link rel="stylesheet" href="assets/css/foundation.min.css" />
<link rel="stylesheet" href="owlcarousel/owl.carousel.css">
<link rel="stylesheet" href="owlcarousel/owl.theme.css">
<link rel="stylesheet" href="assets/js/highlight/styles/monokai_sublime.css">
<link rel="stylesheet" href="assets/css/demo.css">
<link rel="stylesheet" href="assets/css/devices.css">
</head>
<body>
<div id="devices-container">
<div class="devices-buttons clearfix">
<a class="desktop-icon active" data-device="desktop">
<span class="desktop-icon-foot"></span>
</a>
<a class="tablet-icon" data-device="tablet">
<span class="tablet-icon-button"></span>
</a>
<a class="mobile-icon" data-device="mobile">
<span class="mobile-icon-button"></span>
</a>
</div>
<div id="devices" class="desktop">
<div class="frame-outer">
<div class="camera"></div>
<div class="mic"></div>
<div class="screen">
<div id="devices-demo" class="owl-inside">
<div class="article "><h2>Drag it.</h2></div>
<div class="article curry"><h2></h2></div>
<div class="article curry"><h2></h2></div>
<div class="article curry"><h2></h2></div>
<div class="article curry"><h2></h2></div>
<div class="article-video" data-merge="2"><a class="owl-video" href="https://www.youtube.com/watch?v=RMaQ2eR5IDE"></a></div>
<div class="article-video" data-merge="2"><a class="owl-video" href="https://www.youtube.com/watch?v=3NPxqXMZq7o"></a></div>
<div class="article-video"><a class="owl-video" href="https://www.youtube.com/watch?v=igHACewkX-I"></a></div>
<div class="article curry"><h2></h2></div>
<div class="article curry"><h2></h2></div>
<div class="article curry"><h2></h2></div>
<div class="article curry"><h2></h2></div>
<div class="article curry"><h2></h2></div>
</div>
</div>
</div>
<div class="screen-bottom">
<div class="owl-desktop-logo">Owl Carousel 2</div>
<div class="push">
<div class="square"></div>
</div>
</div>
<div class="footer-container">
<div class="foot"></div>
<div class="foot-shadow-top"></div>
<div class="foot-bottom"></div>
</div>
</div>
</div>
<div class="header">
<div class="row">
<div class="large-12 columns">
<h1>Owl Carousel <small>v2.0.0-beta.1.8</span></small></h1>
<p>Please note that this is a beta version only for testing purposes. Enjoy!</p>
<a href="https://github.com/OwlFonk/OwlCarousel2" class="button tiny secondary">Download From GitHub</a>
</div>
</div>
</div>
<div class="frotpage-demo margin-top">
<div class="row">
<div class="large-12 columns">
<div class="owl-carousel">
<div class="article"><h2>1</h2></div>
<div class="article"><h2>2</h2></div>
<div class="article"><h2>3</h2></div>
<div class="article"><h2>4</h2></div>
<div class="article"><h2>6</h2></div>
<div class="article-video" data-merge="2"><a class="owl-video" href="https://www.youtube.com/watch?v=RMaQ2eR5IDE"></a></div>
<div class="article-video" data-merge="2"><a class="owl-video" href="https://www.youtube.com/watch?v=3NPxqXMZq7o"></a></div>
<div class="article-video"><a class="owl-video" href="https://www.youtube.com/watch?v=igHACewkX-I"></a></div>
<div class="article"><h2>8</h2></div>
<div class="article"><h2>9</h2></div>
<div class="article"><h2>10</h2></div>
<div class="article"><h2>11</h2></div>
<div class="article"><h2>13</h2></div>
</div>
</div>
</div>
</div>
<div class="content">
<div class="code">
<div class="row margin-top">
<div class="large-12 columns">
<pre><code>
//Javascript
$('.owl-carousel').owlCarousel({
items: 1,
loop: true,
margin: 10,
lazyLoad: true,
merge: true,
video: true,
responsive:{
480:{
items:2
},
678:{
items:3
},
960:{
items:5
}
}
});
</code></pre>
</div>
</div>
</div>
<div class="row margin-top">
<div class="large-12 columns">
<h3>New features</h3>
<hr>
<ul>
<li>Brand new code</li>
<li>Infinity Loop</li>
<li>Center item</li>
<li>Handle 1000's items on mobile devices</li>
<li>Smart Speed</li>
<li>Stage Padding</li>
<li>Item Margin</li>
<li>Ability to make almost all option responsive</li>
<li>Various Widths</li>
<li>Callback Events</li>
<li>YouTube/Vimeo support (fetching thumbnails as well)</li>
<li>Fixed click delegation issues</li>
<li>Anchors navigation</li>
<li>Merged Items</li>
<li>RTL</li>
<li>More to come...</li>
</ul>
<h3>To do</h3>
<hr>
<ul>
<li>Clean the code</li>
<li>require.js support</li>
<li>Bower Support</li>
<li>Inprove CSS</li>
<li>Create new theme</li>
<li>Video Names</li>
</ul>
</div>
</div>
<div class="demos-buttons">
<div class="row">
<div class="large-12 columns">
<h3>Demos:</h3>
<hr>
<a href="demos/responsiveoptions.html" class="button">Responsive options</a>
<a href="demos/center.html" class="button">Center</a>
<a href="demos/lazyload.html" class="button">Lazy Load</a>
<a href="demos/merge.html" class="button">Merge</a>
<a href="demos/autowidth.html" class="button">Auto Width</a>
<a href="demos/videos.html" class="button">Videos</a>
<a href="demos/autoplay.html" class="button">Autoplay</a>
<a href="demos/urlhash.html" class="button">URL hash navigation</a>
<a href="demos/callbacks.html" class="button">Callbacks</a>
<a href="demos/info.html" class="button">Info callback</a>
<a href="demos/rtl.html" class="button">Right to left</a>
<a href="demos/manipulations.html" class="button">Manipulations</a>
<a href="demos/ajax.html" class="button">Ajax</a>
<a href="demos/nestedItemSelector.html" class="button">Nested Item Selector</a>
<a href="demos/autoHeight.html" class="button">AutoHeight</a>
<a href="demos/thumbnails.html" class="button">Dot Thumbnails</a>
<a href="demos/lazyContent.html" class="button">Lazy Content Structure</a>
<a href="demos/ajaxLazyContent.html" class="button">Ajax + Lazy Content</a>
<a href="demos/zepto.html" class="button">Zepto Support</a>
<a href="demos/animate.html" class="button">Animate Transitions</a>
</div>
</div>
</div>
<div class="row margin-top">
<div class="large-12 columns">
<h3>Installation:</h3>
</div>
</div>
<div class="code">
<div class="row ">
<div class="large-12 columns">
<pre><code>
<!-- Required Owl stylesheet -->
<link rel="stylesheet" href="owlcarousel/owl.carousel.css">
<!-- Optional Owl default theme stylesheet -->
<link rel="stylesheet" href="owlcarousel/owl.theme.css">
<!-- jQuery 1.7+ -->
<script src="jquery-1.11.0.min.js"></script>
<!-- Include js plugin -->
<script src="owlcarousel/owl.carousel.js"></script>
<!-- Set up your HTML -->
<!-- You don't need any special markup. All you need is to wrap your divs(owl works with any type element) inside the container element <div class="owl-carousel">. Class "owl-carousel" is mandatory to apply proper styles that come from owl.carousel.css file. -->
<div id="owl-example" class="owl-carousel">
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
<div> Your Content </div>
...
</div>
<!-- Call the plugin -->
<script>
$(document).ready(function(){
$("#owl-example").owlCarousel();
});
</script>
</code></pre>
</div>
</div>
</div>
<div class="row show-for-medium-up margin-top">
<div class="large-12 columns">
<h3>Options:</h3>
<table>
<thead>
<tr>
<th width="200">Option Name</th>
<th>Default</th>
<th>Type</th>
<th width="500">Description</th>
<th>status</th>
</tr>
</thead>
<tbody>
<tr>
<td>items</td>
<td>3</td>
<td>Int</td>
<td>How many items you want to see on screen</td>
<td></td>
</tr>
<tr>
<td>loop</td>
<td>false</td>
<td>Boolean</td>
<td>Inifnity loop</td>
<td></td>
</tr>
<tr>
<td>center</td>
<td>false</td>
<td>Boolean</td>
<td>Center item.</td>
<td></td>
</tr>
<tr>
<td>mouseDrag</td>
<td>true</td>
<td>Boolean</td>
<td>Mouse drag enabled</td>
<td></td>
</tr>
<tr>
<td>touchDrag</td>
<td>true</td>
<td>Boolean</td>
<td>Touch drag enabled</td>
<td></td>
</tr>
<tr>
<td>pullDrag</td>
<td>true</td>
<td>Boolean</td>
<td>Stage egde pull</td>
<td></td>
</tr>
<tr>
<td>freeDrag</td>
<td>false</td>
<td>Boolean</td>
<td>Items edge pull</td>
<td></td>
</tr>
<tr>
<td>margin</td>
<td>0</td>
<td>Int</td>
<td>margin-right(px) on item. </td>
<td></td>
</tr>
<tr>
<td>stagePadding</td>
<td>0</td>
<td>Int</td>
<td>Padding left and right on stage (can see neighbours).</td>
<td></td>
</tr>
<tr>
<td>merge</td>
<td>false</td>
<td>Boolean</td>
<td>Merge items. Looking for data-merge="{number}" inside item.</td>
<td></td>
</tr>
<tr>
<td>mergeFit</td>
<td>true</td>
<td>Boolean</td>
<td>Fit merged items if screen is smaller than items value.</td>
<td></td>
</tr>
<tr>
<td>autoWidth</td>
<td>false</td>
<td>Boolean</td>
<td>Set non grid content. Try using width style on divs.</td>
<td><span class="label alert">Needs test</span></td>
</tr>
<tr>
<td>startPosition</td>
<td>0</td>
<td>Int/string</td>
<td>Start position or URL Hash string like '#id'</td>
<td></td>
</tr>
<tr>
<td>URLhashListener</td>
<td>false</td>
<td>Boolean</td>
<td>Listen to url hash changes. data-hash on items is required.</td>
<td></td>
</tr>
<tr>
<td>nav</td>
<td>false</td>
<td>Boolean</td>
<td>Show next/prev buttons</td>
<td></td>
</tr>
<tr>
<td>navRewind</td>
<td>true</td>
<td>Boolean</td>
<td>Go to first/last</td>
<td></td>
</tr>
<tr>
<td>navText</td>
<td>['next','prev']</td>
<td>array</td>
<td>HTML allowed.</td>
<td></td>
</tr>
<tr>
<td>slideBy</td>
<td>1</td>
<td>Int/String</td>
<td>Navigation slide by x. 'page' string can be set slide by page</td>
<td></td>
</tr>
<tr>
<td>dots</td>
<td>true</td>
<td>Boolean</td>
<td>Show dots navigation</td>
<td></td>
</tr>
<tr>
<td>dotsEach</td>
<td>false</td>
<td>Int/Boolean</td>
<td>Show dots each x item</td>
<td></td>
</tr>
<tr>
<td>dotData</td>
<td>false</td>
<td>Boolean</td>
<td>Used by data-dot content</td>
<td></td>
</tr>
<tr>
<td>lazyLoad</td>
<td>false</td>
<td>Boolean</td>
<td>Lazy load images. data-src and data-src-retina for highres</td>
<td></td>
</tr>
<tr>
<td>lazyContent</td>
<td>false</td>
<td>Boolean</td>
<td>Special Owl structure for heavy content carousel. Great for better mobile experience. There are some limitation but i strogly recommend this option for all heavy content mobile fallbacks.</td>
<td></td>
</tr>
<tr>
<td>autoplay</td>
<td>false</td>
<td>Boolean</td>
<td>Autoplay</td>
<td></td>
</tr>
<tr>
<td>autoplayTimeout</td>
<td>5000</td>
<td>Int</td>
<td>Autoplay interval timeout</td>
<td></td>
</tr>
<tr>
<td>autoplayHoverPause</td>
<td>false</td>
<td>Boolean</td>
<td>Pause on mouse hover</td>
<td></td>
</tr>
<tr>
<td>smartSpeed</td>
<td>250</td>
<td>Int</td>
<td>Speed Calculate. More info to come...</td>
<td></td>
</tr>
<tr>
<td>fluidSpeed</td>
<td>false</td>
<td>Int</td>
<td>Speed Calculate. More info to come...</td>
<td><span class="label alert">To do</span></td>
</tr>
<tr>
<td>autoplaySpeed</td>
<td>false</td>
<td>Int/Boolean</td>
<td>autoplay speed</td>
<td></td>
</tr>
<tr>
<td>navSpeed</td>
<td>false</td>
<td>Int/Boolean</td>
<td>Navigation speed</td>
<td></td>
</tr>
<tr>
<td>dotsSpeed</td>
<td>false</td>
<td>Int/Boolean</td>
<td>Pagination speed</td>
<td></td>
</tr>
<tr>
<td>dragEndSpeed</td>
<td>false</td>
<td>Int/Boolean</td>
<td>Drag end speed</td>
<td></td>
</tr>
<tr>
<td>callbacks</td>
<td>false</td>
<td>Boolean</td>
<td>Enable callback events</td>
<td></td>
</tr>
<tr>
<td>responsive</td>
<td>empty object</td>
<td>object/boolean</td>
<td>Object containing responsive options. Can be set to false to remove responive capabilities</td>
<td></td>
</tr>
<tr>
<td>responsiveRefreshRate</td>
<td>200</td>
<td>Int</td>
<td>Responsive refresh rate</td>
<td></td>
</tr>
<tr>
<td>responsiveBaseElement</td>
<td>window</td>
<td>DOM element</td>
<td>Set on any DOM element. If you care about non responsive browser (like ie8) then use it on main wrapper. This will prevent from crazy resizing.</td>
<td></td>
</tr>
<tr>
<td>responsiveClass</td>
<td>false</td>
<td>Boolean</td>
<td>Optional helper class. Add 'owl-reponsive-' + 'breakpoint' class to main element. Can be used to stylize content on given breakpoint.</td>
<td></td>
</tr>
<tr>
<td>video</td>
<td>false</td>
<td>Boolean</td>
<td>Enable fetching YouTube/Vimeo videos</td>
<td></td>
</tr>
<tr>
<td>videoHeight</td>
<td>false</td>
<td>Int/Boolean</td>
<td>Set height for videos</td>
<td></td>
</tr>
<tr>
<td>videoWidth</td>
<td>false</td>
<td>Int/Boolean</td>
<td>Set width for videos</td>
<td></td>
</tr>
<tr>
<td>animateOut</td>
<td>false</td>
<td>Bolean/String</td>
<td>CSS3 animation out</td>
<td></td>
</tr>
<tr>
<td>animateIn</td>
<td>false</td>
<td>Bolean/String</td>
<td>CSS3 animation in</td>
<td></td>
</tr>
<tr>
<td>mobileBoost</td>
<td>false</td>
<td>Boolean</td>
<td>Boost performance on mobiles</td>
<td></td>
</tr>
<tr>
<td>fallbackEasing</td>
<td>'swing'</td>
<td>string</td>
<td>Ease for CSS2 $.animate</td>
<td></td>
</tr>
<tr>
<td>info</td>
<td>false</td>
<td>function</td>
<td>The only one Owl function callback to retrieve basic information (current item/pages/widths).
Info function second parameter is Owl DOM object reference.
</td>
<td></td>
</tr>
<tr>
<td>nestedItemSelector</td>
<td>false</td>
<td>String/Class</td>
<td>Use it if owl items are deep nasted inside some generated content. E.g 'youritem'. Dont use dot before class name.</td>
<td></td>
</tr>
<tr>
<td>itemElement</td>
<td>'div'</td>
<td>String</td>
<td>DOM element type for owl-item</td>
<td></td>
</tr>
<tr>
<td>stageElement</td>
<td>'div'</td>
<td>String</td>
<td>DOM element type for owl-stage</td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td>And many more options for class names</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="code">
<div class="row margin-top">
<div class="large-12 columns">
<pre><code>
Callback events:
//To use callbacks enable {callbacks:true}
'onInitBefore'
'onInitAfter'
'onResponsiveBefore'
'onResponsiveAfter'
'onTransitionStart'
'onTransitionEnd'
'onTouchStart'
'onTouchEnd'
'onChangeState'
'onLazyLoaded'
'onVideoPlay'
'onVideoStop'
Custom events:
'next.owl'
'prev.owl'
'goTo.owl'
'jumpTo.owl'
'addItem.owl'
'removeItem.owl'
'insertContent.owl'
'refresh.owl'
'autoHeight.owl'
'play.owl'
'stop.owl'
'stopVideo.owl'
Public methods:
.next(speed)
.prev(speed)
.goTo(position,speed)
.jumpTo(position)
.addItem(content,position)
.removeItem(position)
.insertContent(content)
.refresh()
.autoHeight()
.play(timeout,speed)
.stop()
.stopVideo()
</code></pre>
</div>
</div>
</div>
<div class="row margin-top">
<div class="large-12 columns">
<h3>Notes:</h3>
<hr>
<p>Owl Carousel 2 is not compatibile with previous iterations <2 but has many in common. <br>
Testing on IE7/8/9/10, Latest Chrome, FF and Opera. Latest Android and iOS6/7. <br>
Sorry for any typos in documentation. This is just an early demo and will try to fix everything in a time.
</p>
</div>
</div>
</div>
<div class="footer">
<div class="row margin-top">
<div class="large-12 columns">
<hr>
<p>Bartosz Wojciechowski 2014. <a href="mailto:[email protected]">[email protected]</a></p>
</div>
</div>
</div>
<!-- Zepto library + Data module
<script src="http://cdnjs.cloudflare.com/ajax/libs/zepto/1.1.3/zepto.min.js"></script>
<script src="assets/js/zepto.data.js"></script>
-->
<script src="assets/js/jquery-1.11.0.min.js"></script>
<script src="owlcarousel/owl.carousel.js?v=beta.1.8"></script>
<script src="assets/js/highlight/highlight.pack.js"></script>
<script src="assets/js/app.js"></script>
<script src="assets/js/devices.demo.js"></script>
<script>
$(document).ready(function($) {
$('.owl-carousel').owlCarousel({
items:1,
loop:true,
margin:10,
lazyLoad:true, //in this example only applied on video thumbnails
merge: true,
video: true,
responsive:{
480:{
items:2
},
678:{
items:3
},
960:{
items:5
}
}
});
});
</script>
</body>
</html>