回答編集履歴
1
ミスがあったため修正。
test
CHANGED
@@ -30,9 +30,9 @@
|
|
30
30
|
|
31
31
|
$( '.swipebox' ).swipebox( {
|
32
32
|
|
33
|
-
nextSlide: func
|
33
|
+
nextSlide: func
|
34
34
|
|
35
|
-
prevSlide: func
|
35
|
+
, prevSlide: func // ,が抜けていました、すいません。
|
36
36
|
|
37
37
|
} );
|
38
38
|
|
@@ -43,3 +43,107 @@
|
|
43
43
|
</script>
|
44
44
|
|
45
45
|
```
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
---
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
**追記:**
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
ひとまず下記で動くことを確認しました。
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
```HTML
|
62
|
+
|
63
|
+
<link rel="stylesheet" href="src/css/swipebox.css">
|
64
|
+
|
65
|
+
<script>var arr = [];</script>
|
66
|
+
|
67
|
+
<ul class="columns">
|
68
|
+
|
69
|
+
<li class="a-post">
|
70
|
+
|
71
|
+
<img src="http://placehold.it/50"><a rel="gallery" class="swipebox" href="http://placehold.it/300">001</a>
|
72
|
+
|
73
|
+
<script>arr.push( '#ffa' );</script><!-- li要素の外に置かない -->
|
74
|
+
|
75
|
+
</li>
|
76
|
+
|
77
|
+
<li class="a-post">
|
78
|
+
|
79
|
+
<img src="http://placehold.it/50"><a rel="gallery" class="swipebox" href="http://placehold.it/400">002</a>
|
80
|
+
|
81
|
+
<script>arr.push( '#faf' );</script><!-- li要素の外に置かない -->
|
82
|
+
|
83
|
+
</li>
|
84
|
+
|
85
|
+
<li class="a-post">
|
86
|
+
|
87
|
+
<img src="http://placehold.it/50"><a rel="gallery" class="swipebox" href="http://placehold.it/500">003</a>
|
88
|
+
|
89
|
+
<script>arr.push( '#aff' );</script><!-- li要素の外に置かない -->
|
90
|
+
|
91
|
+
</li>
|
92
|
+
|
93
|
+
<li class="a-post">
|
94
|
+
|
95
|
+
<img src="http://placehold.it/50"><a rel="gallery" class="swipebox" href="http://placehold.it/600">004</a>
|
96
|
+
|
97
|
+
<script>arr.push( '#00a' );</script><!-- li要素の外に置かない -->
|
98
|
+
|
99
|
+
</li>
|
100
|
+
|
101
|
+
<li class="a-post">
|
102
|
+
|
103
|
+
<img src="http://placehold.it/50"><a rel="gallery" class="swipebox" href="http://placehold.it/700">005</a>
|
104
|
+
|
105
|
+
<script>arr.push( '#0a0' );</script><!-- li要素の外に置かない -->
|
106
|
+
|
107
|
+
</li>
|
108
|
+
|
109
|
+
<li class="a-post">
|
110
|
+
|
111
|
+
<img src="http://placehold.it/50"><a rel="gallery" class="swipebox" href="http://placehold.it/800">006</a>
|
112
|
+
|
113
|
+
<script>arr.push( '#a00' );</script><!-- li要素の外に置かない -->
|
114
|
+
|
115
|
+
</li>
|
116
|
+
|
117
|
+
</ul>
|
118
|
+
|
119
|
+
<script src="lib/jquery-2.1.0.min.js"></script>
|
120
|
+
|
121
|
+
<script src="src/js/jquery.swipebox.js"></script>
|
122
|
+
|
123
|
+
<script>
|
124
|
+
|
125
|
+
;( function( $ ) {
|
126
|
+
|
127
|
+
var func = function( index ) {
|
128
|
+
|
129
|
+
$( '#swipebox-overlay' ).css( 'background-color', arr[ index ] );
|
130
|
+
|
131
|
+
};
|
132
|
+
|
133
|
+
$( '.swipebox' ).swipebox( {
|
134
|
+
|
135
|
+
afterOpen: func
|
136
|
+
|
137
|
+
, nextSlide: func
|
138
|
+
|
139
|
+
, prevSlide: func
|
140
|
+
|
141
|
+
} );
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
} )( jQuery );
|
146
|
+
|
147
|
+
</script>
|
148
|
+
|
149
|
+
```
|