質問編集履歴
1
モーダルを外すと起動したことからモーダルが原因のようです・・・。
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,4 +6,105 @@
|
|
6
6
|
//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js
|
7
7
|
//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css
|
8
8
|
・スライダーに使っているswiper参考にしたGitHab
|
9
|
-
https://github.com/nolimits4web/Swiper/blob/master/demos/010-default.html
|
9
|
+
https://github.com/nolimits4web/Swiper/blob/master/demos/010-default.html
|
10
|
+
```php
|
11
|
+
<div class="kyousitu_help_btn">
|
12
|
+
<ul>
|
13
|
+
<li id="btn"><a data-toggle="modal" data-target="#btn1" href="#btn1"><span>ボタン1</span></a></li>
|
14
|
+
<li id="jukou"><a data-toggle="modal" data-target="#btn2" href="#btn2"><span>ボタン2</span></a></li>
|
15
|
+
</ul>
|
16
|
+
</div>
|
17
|
+
<!-- Modal content(btn1)-->
|
18
|
+
<div id="btn1" class="modal fade" role="dialog">
|
19
|
+
<div class="modal-dialog">
|
20
|
+
<div class="modal-content">
|
21
|
+
<div class="modal-header">
|
22
|
+
<button type="button" class="close" data-dismiss="modal">×</button>
|
23
|
+
</div>
|
24
|
+
<div class="modal-body">
|
25
|
+
<!-- モーダルボディ -->
|
26
|
+
<div class="swiper-container">
|
27
|
+
<div class="swiper-wrapper">
|
28
|
+
<div class="swiper-slide">
|
29
|
+
<div><h4>1:1枚目</h4></div>
|
30
|
+
<div><p>1枚目</span></p></div>
|
31
|
+
</div>
|
32
|
+
<div class="swiper-slide">
|
33
|
+
<div><h4>2:2枚目</h4></div>
|
34
|
+
<div><p>2枚目</p></div>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
<div class="swiper-pagination"></div>
|
39
|
+
<!-- Add Arrows -->
|
40
|
+
<div class="swiper-button-prev"></div>
|
41
|
+
<div class="swiper-button-next"></div>
|
42
|
+
</div>
|
43
|
+
<div class="modal-footer">
|
44
|
+
<button type="button" class="btn btn-default" data-dismiss="modal">閉じる</button>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
<!-- Modal content(btn2)-->
|
50
|
+
<div id="btn2" class="modal fade" role="dialog">
|
51
|
+
<div class="modal-dialog">
|
52
|
+
<div class="modal-content">
|
53
|
+
<div class="modal-header">
|
54
|
+
<button type="button" class="close" data-dismiss="modal">×</button>
|
55
|
+
</div>
|
56
|
+
<div class="modal-body">
|
57
|
+
<!-- モーダルボディ -->
|
58
|
+
<div class="swiper-container" id="swiper-container">
|
59
|
+
<div class="swiper-wrapper">
|
60
|
+
<div class="swiper-slide">
|
61
|
+
<div><h4>1:1枚目</h4></div>
|
62
|
+
<div><p>1枚目</span></p></div>
|
63
|
+
</div>
|
64
|
+
<div class="swiper-slide">
|
65
|
+
<div><h4>2:2枚目</h4></div>
|
66
|
+
<div><p>2枚目</p></div>
|
67
|
+
</div>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
<div class="swiper-pagination" id="pagination2"></div>
|
71
|
+
<!-- Add Arrows -->
|
72
|
+
<div class="swiper-button-prev" id="prev2"></div>
|
73
|
+
<div class="swiper-button-next" id="next2"></div>
|
74
|
+
</div>
|
75
|
+
<div class="modal-footer">
|
76
|
+
<button type="button" class="btn btn-default" data-dismiss="modal">閉じる</button>
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
<script>
|
82
|
+
console.log('オプション');
|
83
|
+
var swiper = new Swiper('#swiper-container', {
|
84
|
+
navigation: {
|
85
|
+
nextEl: '#next2',
|
86
|
+
prevEl: '#prev2',
|
87
|
+
},
|
88
|
+
pagination: {
|
89
|
+
el: '#pagination2',
|
90
|
+
type: 'bullets',
|
91
|
+
},
|
92
|
+
});
|
93
|
+
( function () {
|
94
|
+
var mySwiper = new Swiper( '.swiper-container', {
|
95
|
+
navigation: {
|
96
|
+
nextEl: '.swiper-button-next',
|
97
|
+
prevEl: '.swiper-button-prev',
|
98
|
+
},
|
99
|
+
pagination: {
|
100
|
+
el: '.swiper-pagination',
|
101
|
+
type: 'bullets',
|
102
|
+
},
|
103
|
+
scrollbar: {
|
104
|
+
el: '.swiper-scrollbar',
|
105
|
+
draggable: true,
|
106
|
+
},
|
107
|
+
});
|
108
|
+
} )();
|
109
|
+
</script>
|
110
|
+
```
|