-
Notifications
You must be signed in to change notification settings - Fork 0
/
swiper.txt
56 lines (52 loc) · 1.97 KB
/
swiper.txt
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
<!-- 幻燈片內容 -->
<div class="swiper-container">
<!-- 外層(必要) -->
<div class="swiper-wrapper">
<!-- 幻燈片內容 -->
<div class="swiper-slide">
<div class='embed-container'><iframe src='https://www.youtube.com/embed//2Wd0BQRqiy8' frameborder='0' allowfullscreen></iframe></div>
<style>
.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; }
.embed-container iframe, .embed-container object,
.embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
</style>
</div>
<div class="swiper-slide">
<style>
.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; }
.embed-container iframe, .embed-container object,
.embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
</style>
<div class='embed-container'><iframe src='https://www.youtube.com/embed//2Wd0BQRqiy8' frameborder='0' allowfullscreen></iframe></div>
</div>
</div>
<!-- 分頁(非必要) -->
<div class="swiper-pagination"></div>
<!-- 上/下一頁按鈕(非必要) -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
<style>
.swiper-container {
/* 設定幻燈片寬度跟高度 */
width: 30em;
height: 30em;
}
</style>
<script>
var mySwiper = new Swiper ( ".swiper-container", {
// 參數設定[註1]
direction: "horizontal", // 方向
loop: true, // 循環
pagination: {
el: ".swiper-pagination", // 分頁物件
},
navigation: {
nextEl: ".swiper-button-next", // 上一頁按鈕物件
prevEl: ".swiper-button-prev", // 下一頁按鈕物件
},
scrollbar: {
el: ".swiper-scrollbar", // 捲軸物件
}
})
</script>