質問編集履歴
6
a
test
CHANGED
File without changes
|
test
CHANGED
@@ -274,7 +274,7 @@
|
|
274
274
|
|
275
275
|
|
276
276
|
|
277
|
-
<script
|
277
|
+
<script>
|
278
278
|
|
279
279
|
$(function(){
|
280
280
|
|
5
tuiki
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,11 +22,217 @@
|
|
22
22
|
|
23
23
|
|
24
24
|
|
25
|
+
![イメージ説明](bad9da8a09688e9cc2afd97abbdeefcf.png)
|
26
|
+
|
27
|
+
|
28
|
+
|
25
29
|
```html
|
26
30
|
|
31
|
+
<!DOCTYPE html>
|
32
|
+
|
33
|
+
<html lang="en" >
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
<head>
|
38
|
+
|
39
|
+
<meta charset="UTF-8">
|
40
|
+
|
41
|
+
<title>A Pen by kingkazuma7</title>
|
42
|
+
|
43
|
+
<!-- <link rel="stylesheet" href="css/style.css"> -->
|
44
|
+
|
45
|
+
<style>
|
46
|
+
|
47
|
+
.contentWrap {
|
48
|
+
|
49
|
+
display: flex;
|
50
|
+
|
51
|
+
width: 960px;
|
52
|
+
|
53
|
+
}
|
54
|
+
|
55
|
+
.contentWrap .acoPic {
|
56
|
+
|
57
|
+
margin-right: 30px;
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
.contentWrap .acoPic:nth-child(3) {
|
62
|
+
|
63
|
+
margin-right: 0;
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
.None {
|
70
|
+
|
71
|
+
display: none;
|
72
|
+
|
73
|
+
}
|
74
|
+
|
75
|
+
.accordion_icon {
|
76
|
+
|
77
|
+
width: 960px;
|
78
|
+
|
79
|
+
position: relative;
|
80
|
+
|
81
|
+
width: 66px;
|
82
|
+
|
83
|
+
height: 66px;
|
84
|
+
|
85
|
+
background: #232e52;
|
86
|
+
|
87
|
+
position: absolute;
|
88
|
+
|
89
|
+
top: 0;
|
90
|
+
|
91
|
+
right: 0;
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
/* アコーディオン± */
|
96
|
+
|
97
|
+
.accordion_icon,
|
98
|
+
|
99
|
+
.accordion_icon span {
|
100
|
+
|
101
|
+
display: inline-block;
|
102
|
+
|
103
|
+
transition: all .4s;
|
104
|
+
|
105
|
+
box-sizing: border-box;
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
.accordion_icon {
|
110
|
+
|
111
|
+
position: relative;
|
112
|
+
|
113
|
+
width: 66px;
|
114
|
+
|
115
|
+
height: 66px;
|
116
|
+
|
117
|
+
background: #232e52;
|
118
|
+
|
119
|
+
position: absolute;
|
120
|
+
|
121
|
+
top: 0;
|
122
|
+
|
123
|
+
right: 0;
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
.accordion_icon span {
|
128
|
+
|
129
|
+
position: absolute;
|
130
|
+
|
131
|
+
left: 16px;
|
132
|
+
|
133
|
+
width: 50%;
|
134
|
+
|
135
|
+
height: 2px;
|
136
|
+
|
137
|
+
background-color: #fff;
|
138
|
+
|
139
|
+
border-radius: 4px;
|
140
|
+
|
141
|
+
-webkit-border-radius: 4px;
|
142
|
+
|
143
|
+
-ms-border-radius: 4px;
|
144
|
+
|
145
|
+
-moz-border-radius: 4px;
|
146
|
+
|
147
|
+
-o-border-radius: 4px;
|
148
|
+
|
149
|
+
}
|
150
|
+
|
151
|
+
.accordion_icon span:nth-of-type(1) {
|
152
|
+
|
153
|
+
top: 50%;
|
154
|
+
|
155
|
+
transform: rotate(0deg);
|
156
|
+
|
157
|
+
-webkit-transform: rotate(0deg);
|
158
|
+
|
159
|
+
-moz-transform: rotate(0deg);
|
160
|
+
|
161
|
+
-ms-transform: rotate(0deg);
|
162
|
+
|
163
|
+
-o-transform: rotate(0deg);
|
164
|
+
|
165
|
+
}
|
166
|
+
|
167
|
+
.accordion_icon span:nth-of-type(2) {
|
168
|
+
|
169
|
+
top: 35px;
|
170
|
+
|
171
|
+
transform: rotate(90deg);
|
172
|
+
|
173
|
+
-webkit-transform: rotate(90deg);
|
174
|
+
|
175
|
+
-moz-transform: rotate(90deg);
|
176
|
+
|
177
|
+
-ms-transform: rotate(90deg);
|
178
|
+
|
179
|
+
-o-transform: rotate(90deg);
|
180
|
+
|
181
|
+
}
|
182
|
+
|
183
|
+
/*+、-切り替え*/
|
184
|
+
|
185
|
+
.accordion_icon.active span:nth-of-type(1) {
|
186
|
+
|
187
|
+
display:none;
|
188
|
+
|
189
|
+
}
|
190
|
+
|
191
|
+
.accordion_icon.active span:nth-of-type(2) {
|
192
|
+
|
193
|
+
top: 35px;
|
194
|
+
|
195
|
+
transform: rotate(180deg);
|
196
|
+
|
197
|
+
-webkit-transform: rotate(180deg);
|
198
|
+
|
199
|
+
-moz-transform: rotate(180deg);
|
200
|
+
|
201
|
+
-ms-transform: rotate(180deg);
|
202
|
+
|
203
|
+
-o-transform: rotate(180deg);
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
.acoTitle {
|
210
|
+
|
211
|
+
font-size: 18px;
|
212
|
+
|
213
|
+
padding: 20px 0 20px 30px;
|
214
|
+
|
215
|
+
background: #EEE;
|
216
|
+
|
217
|
+
margin-bottom: 5px;
|
218
|
+
|
219
|
+
position: relative;
|
220
|
+
|
221
|
+
}
|
222
|
+
|
223
|
+
</style>
|
224
|
+
|
225
|
+
</head>
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
<body>
|
230
|
+
|
231
|
+
|
232
|
+
|
27
|
-
<p class="switch acoTitle">ここを押すとプラスマイナス
|
233
|
+
<p class="switch acoTitle">ここを押すとプラスマイナス
|
28
|
-
|
234
|
+
|
29
|
-
|
235
|
+
<span class="accordion_icon active"><span></span><span></span></span></p>
|
30
236
|
|
31
237
|
<div class="None">
|
32
238
|
|
@@ -66,224 +272,46 @@
|
|
66
272
|
|
67
273
|
</div><!--None-->
|
68
274
|
|
275
|
+
|
276
|
+
|
277
|
+
<script src="/javascripts/application.js" type="text/javascript" charset="utf-8" async defer>
|
278
|
+
|
279
|
+
$(function(){
|
280
|
+
|
281
|
+
$(".switch").on("click", function() {
|
282
|
+
|
283
|
+
$(this).next().slideToggle();
|
284
|
+
|
285
|
+
// activeが存在する場合
|
286
|
+
|
287
|
+
if ($(this).children(".accordion_icon").hasClass('active')) {
|
288
|
+
|
289
|
+
// activeを削除
|
290
|
+
|
291
|
+
$(this).children(".accordion_icon").removeclass('active');
|
292
|
+
|
293
|
+
}
|
294
|
+
|
295
|
+
else {
|
296
|
+
|
297
|
+
// activeを追加
|
298
|
+
|
299
|
+
$(this).children(".accordion_icon").addClass('active');
|
300
|
+
|
301
|
+
}
|
302
|
+
|
303
|
+
}); //switch終わり
|
304
|
+
|
305
|
+
});
|
306
|
+
|
307
|
+
</script>
|
308
|
+
|
309
|
+
</body>
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
</html>
|
314
|
+
|
315
|
+
|
316
|
+
|
69
317
|
```
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
```css
|
74
|
-
|
75
|
-
.contentWrap {
|
76
|
-
|
77
|
-
display: flex;
|
78
|
-
|
79
|
-
width: 960px;
|
80
|
-
|
81
|
-
}
|
82
|
-
|
83
|
-
.contentWrap .acoPic {
|
84
|
-
|
85
|
-
margin-right: 30px;
|
86
|
-
|
87
|
-
}
|
88
|
-
|
89
|
-
.contentWrap .acoPic:nth-child(3) {
|
90
|
-
|
91
|
-
margin-right: 0;
|
92
|
-
|
93
|
-
}
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
.None {
|
98
|
-
|
99
|
-
display: none;
|
100
|
-
|
101
|
-
}
|
102
|
-
|
103
|
-
.accordion_icon {
|
104
|
-
|
105
|
-
width: 960px;
|
106
|
-
|
107
|
-
position: relative;
|
108
|
-
|
109
|
-
width: 66px;
|
110
|
-
|
111
|
-
height: 66px;
|
112
|
-
|
113
|
-
background: #232e52;
|
114
|
-
|
115
|
-
position: absolute;
|
116
|
-
|
117
|
-
top: 0;
|
118
|
-
|
119
|
-
right: 0;
|
120
|
-
|
121
|
-
}
|
122
|
-
|
123
|
-
/* アコーディオン± */
|
124
|
-
|
125
|
-
.accordion_icon,
|
126
|
-
|
127
|
-
.accordion_icon span {
|
128
|
-
|
129
|
-
display: inline-block;
|
130
|
-
|
131
|
-
transition: all .4s;
|
132
|
-
|
133
|
-
box-sizing: border-box;
|
134
|
-
|
135
|
-
}
|
136
|
-
|
137
|
-
.accordion_icon {
|
138
|
-
|
139
|
-
position: relative;
|
140
|
-
|
141
|
-
width: 66px;
|
142
|
-
|
143
|
-
height: 66px;
|
144
|
-
|
145
|
-
background: #232e52;
|
146
|
-
|
147
|
-
position: absolute;
|
148
|
-
|
149
|
-
top: 0;
|
150
|
-
|
151
|
-
right: 0;
|
152
|
-
|
153
|
-
}
|
154
|
-
|
155
|
-
.accordion_icon span {
|
156
|
-
|
157
|
-
position: absolute;
|
158
|
-
|
159
|
-
left: 16px;
|
160
|
-
|
161
|
-
width: 50%;
|
162
|
-
|
163
|
-
height: 2px;
|
164
|
-
|
165
|
-
background-color: #fff;
|
166
|
-
|
167
|
-
border-radius: 4px;
|
168
|
-
|
169
|
-
-webkit-border-radius: 4px;
|
170
|
-
|
171
|
-
-ms-border-radius: 4px;
|
172
|
-
|
173
|
-
-moz-border-radius: 4px;
|
174
|
-
|
175
|
-
-o-border-radius: 4px;
|
176
|
-
|
177
|
-
}
|
178
|
-
|
179
|
-
.accordion_icon span:nth-of-type(1) {
|
180
|
-
|
181
|
-
top: 50%;
|
182
|
-
|
183
|
-
transform: rotate(0deg);
|
184
|
-
|
185
|
-
-webkit-transform: rotate(0deg);
|
186
|
-
|
187
|
-
-moz-transform: rotate(0deg);
|
188
|
-
|
189
|
-
-ms-transform: rotate(0deg);
|
190
|
-
|
191
|
-
-o-transform: rotate(0deg);
|
192
|
-
|
193
|
-
}
|
194
|
-
|
195
|
-
.accordion_icon span:nth-of-type(2) {
|
196
|
-
|
197
|
-
top: 35px;
|
198
|
-
|
199
|
-
transform: rotate(90deg);
|
200
|
-
|
201
|
-
-webkit-transform: rotate(90deg);
|
202
|
-
|
203
|
-
-moz-transform: rotate(90deg);
|
204
|
-
|
205
|
-
-ms-transform: rotate(90deg);
|
206
|
-
|
207
|
-
-o-transform: rotate(90deg);
|
208
|
-
|
209
|
-
}
|
210
|
-
|
211
|
-
/*+、-切り替え*/
|
212
|
-
|
213
|
-
.accordion_icon.active span:nth-of-type(1) {
|
214
|
-
|
215
|
-
display:none;
|
216
|
-
|
217
|
-
}
|
218
|
-
|
219
|
-
.accordion_icon.active span:nth-of-type(2) {
|
220
|
-
|
221
|
-
top: 35px;
|
222
|
-
|
223
|
-
transform: rotate(180deg);
|
224
|
-
|
225
|
-
-webkit-transform: rotate(180deg);
|
226
|
-
|
227
|
-
-moz-transform: rotate(180deg);
|
228
|
-
|
229
|
-
-ms-transform: rotate(180deg);
|
230
|
-
|
231
|
-
-o-transform: rotate(180deg);
|
232
|
-
|
233
|
-
}
|
234
|
-
|
235
|
-
```
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
```javascript
|
240
|
-
|
241
|
-
$(function(){
|
242
|
-
|
243
|
-
$(".switch").on("click", function() {
|
244
|
-
|
245
|
-
$(this).next().slideToggle();
|
246
|
-
|
247
|
-
// activeが存在する場合
|
248
|
-
|
249
|
-
if ($(this).children(".accordion_icon").hasClass('active')) {
|
250
|
-
|
251
|
-
// activeを削除
|
252
|
-
|
253
|
-
$(this).children(".accordion_icon").removeclass('active');
|
254
|
-
|
255
|
-
}
|
256
|
-
|
257
|
-
else {
|
258
|
-
|
259
|
-
// activeを追加
|
260
|
-
|
261
|
-
$(this).children(".accordion_icon").addClass('active');
|
262
|
-
|
263
|
-
}
|
264
|
-
|
265
|
-
}); //switch終わり
|
266
|
-
|
267
|
-
});
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
// activeのつけはずしできてる、
|
272
|
-
|
273
|
-
// $(function(){
|
274
|
-
|
275
|
-
// $(".switch").on("click", function() {
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
// $(this).next().slideToggle();
|
280
|
-
|
281
|
-
// $(this).toggleClass("active");
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
// }); //switch終わり
|
286
|
-
|
287
|
-
// });
|
288
|
-
|
289
|
-
```
|
4
戻し
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>)jQueryでプラスマイナスでコンテンツを開け閉めすることがやりたいです。
|
1
|
+
jQueryでプラスマイナスでコンテンツを開け閉めすることがやりたいです。
|
4
2
|
|
5
3
|
理想として下記サイトのような形でコンテンツを追加するということです。
|
6
4
|
|
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
[あ](<p data-height="265" data-theme-id="0" data-slug-hash="WzzQaR" data-default-tab="css,result" data-user="kingkazuma7" data-embed-version="2" data-pen-title="WzzQaR" class="codepen">See the Pen <a href="https://codepen.io/kingkazuma7/pen/WzzQaR/">WzzQaR</a> by kingkazuma7 (<a href="https://codepen.io/kingkazuma7">@kingkazuma7</a>) on <a href="https://codepen.io">CodePen</a>.</p>
|
2
|
+
|
3
|
+
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>)jQueryでプラスマイナスでコンテンツを開け閉めすることがやりたいです。
|
2
4
|
|
3
5
|
理想として下記サイトのような形でコンテンツを追加するということです。
|
4
6
|
|
@@ -287,7 +289,3 @@
|
|
287
289
|
// });
|
288
290
|
|
289
291
|
```
|
290
|
-
|
291
|
-
<iframe height='265' scrolling='no' title='WzzQaR' src='//codepen.io/kingkazuma7/embed/WzzQaR/?height=265&theme-id=0&default-tab=css,result&embed-version=2' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'>See the Pen <a href='https://codepen.io/kingkazuma7/pen/WzzQaR/'>WzzQaR</a> by kingkazuma7 (<a href='https://codepen.io/kingkazuma7'>@kingkazuma7</a>) on <a href='https://codepen.io'>CodePen</a>.
|
292
|
-
|
293
|
-
</iframe>
|
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -288,6 +288,6 @@
|
|
288
288
|
|
289
289
|
```
|
290
290
|
|
291
|
-
<
|
292
|
-
|
293
|
-
<
|
291
|
+
<iframe height='265' scrolling='no' title='WzzQaR' src='//codepen.io/kingkazuma7/embed/WzzQaR/?height=265&theme-id=0&default-tab=css,result&embed-version=2' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'>See the Pen <a href='https://codepen.io/kingkazuma7/pen/WzzQaR/'>WzzQaR</a> by kingkazuma7 (<a href='https://codepen.io/kingkazuma7'>@kingkazuma7</a>) on <a href='https://codepen.io'>CodePen</a>.
|
292
|
+
|
293
|
+
</iframe>
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -287,3 +287,7 @@
|
|
287
287
|
// });
|
288
288
|
|
289
289
|
```
|
290
|
+
|
291
|
+
<p data-height="265" data-theme-id="0" data-slug-hash="WzzQaR" data-default-tab="css,result" data-user="kingkazuma7" data-embed-version="2" data-pen-title="WzzQaR" class="codepen">See the Pen <a href="https://codepen.io/kingkazuma7/pen/WzzQaR/">WzzQaR</a> by kingkazuma7 (<a href="https://codepen.io/kingkazuma7">@kingkazuma7</a>) on <a href="https://codepen.io">CodePen</a>.</p>
|
292
|
+
|
293
|
+
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
|