質問編集履歴
3
javascriptとcssのインデントを直しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -261,7 +261,6 @@
|
|
261
261
|
switchAccordion,
|
262
262
|
touchSupported = ('ontouchstart' in window),
|
263
263
|
pointerSupported = ('pointerdown' in window);
|
264
|
-
|
265
264
|
skipClickDelay = function(e){
|
266
265
|
e.preventDefault();
|
267
266
|
e.target.click();
|
@@ -273,17 +272,17 @@
|
|
273
272
|
setAccordionAria = function(el1, el2, expanded){
|
274
273
|
switch(expanded) {
|
275
274
|
case "true":
|
276
|
-
|
275
|
+
setAriaAttr(el1, 'aria-expanded', 'true');
|
277
|
-
|
276
|
+
setAriaAttr(el2, 'aria-hidden', 'false');
|
278
|
-
|
277
|
+
break;
|
279
278
|
case "false":
|
280
|
-
|
279
|
+
setAriaAttr(el1, 'aria-expanded', 'false');
|
281
|
-
|
280
|
+
setAriaAttr(el2, 'aria-hidden', 'true');
|
282
|
-
|
281
|
+
break;
|
283
282
|
default:
|
284
|
-
|
283
|
+
break;
|
285
|
-
|
284
|
+
}
|
286
|
-
|
285
|
+
};
|
287
286
|
//function
|
288
287
|
switchAccordion = function(e) {
|
289
288
|
console.log("triggered");
|
@@ -295,12 +294,11 @@
|
|
295
294
|
} else {
|
296
295
|
setAccordionAria(thisQuestion, thisAnswer, 'false');
|
297
296
|
}
|
298
|
-
|
297
|
+
thisQuestion.classList.toggle('is-collapsed');
|
299
|
-
|
298
|
+
thisQuestion.classList.toggle('is-expanded');
|
300
299
|
thisAnswer.classList.toggle('is-collapsed');
|
301
300
|
thisAnswer.classList.toggle('is-expanded');
|
302
|
-
|
303
|
-
|
301
|
+
thisAnswer.classList.toggle('animateIn');
|
304
302
|
};
|
305
303
|
for (var i=0,len=accordionToggles.length; i<len; i++) {
|
306
304
|
if(touchSupported) {
|
2
javascriptを追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -253,74 +253,63 @@
|
|
253
253
|
}
|
254
254
|
```
|
255
255
|
```
|
256
|
-
jQuery(function
|
256
|
+
jQuery(function(){
|
257
|
+
var d = document,
|
258
|
+
accordionToggles = d.querySelectorAll('.js-accordionTrigger'),
|
259
|
+
setAria,
|
260
|
+
setAccordionAria,
|
261
|
+
switchAccordion,
|
262
|
+
touchSupported = ('ontouchstart' in window),
|
263
|
+
pointerSupported = ('pointerdown' in window);
|
264
|
+
|
265
|
+
skipClickDelay = function(e){
|
266
|
+
e.preventDefault();
|
257
|
-
|
267
|
+
e.target.click();
|
268
|
+
}
|
258
269
|
|
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
|
-
jQuery(window).trigger('resize');
|
309
|
-
|
310
|
-
});
|
311
|
-
|
312
|
-
//Mobile Search Box
|
313
|
-
jQuery(window).on("load", function () {
|
314
|
-
jQuery('.wsmobileheader .wssearch').on("click", function () {
|
315
|
-
jQuery(this).toggleClass("wsopensearch");
|
316
|
-
});
|
317
|
-
jQuery("body, .wsopensearch .wscloseicon").on("click", function () {
|
318
|
-
jQuery(".wssearch").removeClass('wsopensearch');
|
319
|
-
});
|
320
|
-
jQuery(".wssearch, .wssearchform form").on("click", function (e) {
|
321
|
-
e.stopPropagation();
|
322
|
-
});
|
323
|
-
});
|
324
|
-
|
325
|
-
}());
|
270
|
+
setAriaAttr = function(el, ariaType, newProperty){
|
271
|
+
el.setAttribute(ariaType, newProperty);
|
272
|
+
};
|
273
|
+
setAccordionAria = function(el1, el2, expanded){
|
274
|
+
switch(expanded) {
|
275
|
+
case "true":
|
276
|
+
setAriaAttr(el1, 'aria-expanded', 'true');
|
277
|
+
setAriaAttr(el2, 'aria-hidden', 'false');
|
278
|
+
break;
|
279
|
+
case "false":
|
280
|
+
setAriaAttr(el1, 'aria-expanded', 'false');
|
281
|
+
setAriaAttr(el2, 'aria-hidden', 'true');
|
282
|
+
break;
|
283
|
+
default:
|
284
|
+
break;
|
285
|
+
}
|
286
|
+
};
|
287
|
+
//function
|
288
|
+
switchAccordion = function(e) {
|
289
|
+
console.log("triggered");
|
290
|
+
e.preventDefault();
|
291
|
+
var thisAnswer = e.target.parentNode.nextElementSibling;
|
292
|
+
var thisQuestion = e.target;
|
293
|
+
if(thisAnswer.classList.contains('is-collapsed')) {
|
294
|
+
setAccordionAria(thisQuestion, thisAnswer, 'true');
|
295
|
+
} else {
|
296
|
+
setAccordionAria(thisQuestion, thisAnswer, 'false');
|
297
|
+
}
|
298
|
+
thisQuestion.classList.toggle('is-collapsed');
|
299
|
+
thisQuestion.classList.toggle('is-expanded');
|
300
|
+
thisAnswer.classList.toggle('is-collapsed');
|
301
|
+
thisAnswer.classList.toggle('is-expanded');
|
302
|
+
|
303
|
+
thisAnswer.classList.toggle('animateIn');
|
304
|
+
};
|
305
|
+
for (var i=0,len=accordionToggles.length; i<len; i++) {
|
306
|
+
if(touchSupported) {
|
307
|
+
accordionToggles[i].addEventListener('touchstart', skipClickDelay, false);
|
308
|
+
}
|
309
|
+
if(pointerSupported){
|
310
|
+
accordionToggles[i].addEventListener('pointerdown', skipClickDelay, false);
|
311
|
+
}
|
312
|
+
accordionToggles[i].addEventListener('click', switchAccordion, false);
|
313
|
+
}
|
314
|
+
})();
|
326
315
|
```
|
1
コードを変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -11,7 +11,13 @@
|
|
11
11
|
どうすれば直りますでしょうか?
|
12
12
|
|
13
13
|
```
|
14
|
+
<section class="question-content">
|
15
|
+
<div class="question-content-wrap">
|
16
|
+
<div class="question-content-wrap-ttl">
|
17
|
+
<h1>よくある質問(FAQ)</h1>
|
18
|
+
</div>
|
19
|
+
<div class="question-content-wrap-list">
|
14
|
-
<div class="question-content-wrap-list-container">
|
20
|
+
<div class="question-content-wrap-list-container">
|
15
21
|
<div class="accordion">
|
16
22
|
<dl>
|
17
23
|
<dt>
|
@@ -38,125 +44,212 @@
|
|
38
44
|
</dl>
|
39
45
|
</div>
|
40
46
|
</div>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
</section>
|
41
50
|
```
|
42
51
|
```
|
52
|
+
.question-content {
|
53
|
+
height: auto;
|
54
|
+
min-height: 600px;
|
55
|
+
background-color: white;
|
56
|
+
border: 1vw solid #5BCBAC;
|
57
|
+
padding-top: 30px;
|
58
|
+
}
|
59
|
+
|
60
|
+
.question-content-wrap {
|
61
|
+
max-width: 1080px;
|
62
|
+
margin: 0 auto;
|
63
|
+
}
|
64
|
+
|
65
|
+
.question-content-wrap-ttl {
|
66
|
+
text-align: center;
|
67
|
+
}
|
68
|
+
|
69
|
+
.question-content-wrap-ttl h1 {
|
70
|
+
font-weight: bold;
|
71
|
+
font-size: 42px;
|
72
|
+
margin-bottom: 0px;
|
73
|
+
}
|
74
|
+
|
43
75
|
.accordion dl,
|
44
76
|
.accordion-list {
|
45
|
-
|
77
|
+
border: 1px solid #ddd;
|
46
|
-
&:after {
|
47
|
-
content: "";
|
48
|
-
display:block;
|
49
|
-
height:1em;
|
50
|
-
width:100%;
|
51
|
-
background-color:darken(#38cc70, 10%);
|
52
|
-
}
|
53
78
|
}
|
79
|
+
|
80
|
+
.accordion dl:after,
|
81
|
+
.accordion-list:after {
|
82
|
+
content: "";
|
83
|
+
display: block;
|
84
|
+
height: 1em;
|
85
|
+
width: 100%;
|
86
|
+
background-color: #2ba659;
|
87
|
+
}
|
88
|
+
|
54
89
|
.accordion dd,
|
55
90
|
.accordion__panel {
|
56
|
-
|
91
|
+
background-color: #eee;
|
57
|
-
|
92
|
+
font-size: 1em;
|
58
|
-
|
93
|
+
line-height: 1.5em;
|
59
94
|
}
|
95
|
+
|
60
96
|
.accordion p {
|
61
|
-
padding:1em 2em 1em 2em;
|
97
|
+
padding: 1em 2em 1em 2em;
|
62
98
|
}
|
63
99
|
|
64
100
|
.accordion {
|
65
|
-
|
101
|
+
position: relative;
|
66
|
-
|
102
|
+
background-color: #eee;
|
67
103
|
}
|
104
|
+
|
68
105
|
.question-content-wrap-list-container {
|
69
|
-
max-width:960px;
|
106
|
+
max-width: 960px;
|
70
|
-
margin:0 auto;
|
107
|
+
margin: 0 auto;
|
71
|
-
padding:2em 0 2em 0;
|
108
|
+
padding: 2em 0 2em 0;
|
72
109
|
}
|
110
|
+
|
73
111
|
.accordionTitle,
|
74
112
|
.accordion__Heading {
|
75
|
-
|
113
|
+
background-color: #38cc70;
|
76
|
-
|
114
|
+
text-align: center;
|
77
|
-
|
115
|
+
font-weight: 700;
|
78
|
-
|
116
|
+
padding: 2em;
|
79
|
-
|
117
|
+
display: block;
|
80
|
-
|
118
|
+
text-decoration: none;
|
81
|
-
|
119
|
+
color: #fff;
|
120
|
+
-webkit-transition: background-color 0.5s ease-in-out;
|
82
|
-
|
121
|
+
transition: background-color 0.5s ease-in-out;
|
83
|
-
border-bottom:1px solid
|
122
|
+
border-bottom: 1px solid #30bb64;
|
84
|
-
&:before {
|
85
|
-
content: "+";
|
86
|
-
font-size:2.5em;
|
87
|
-
line-height:0.5em;
|
88
|
-
float: right;
|
89
|
-
transition: transform 0.3s ease-in-out;
|
90
|
-
}
|
91
|
-
&:hover {
|
92
|
-
background-color:darken(#38cc70, 10%);
|
93
|
-
}
|
94
|
-
&:after {
|
95
|
-
content: "Q";
|
96
|
-
font-size:2.5em;
|
97
|
-
line-height:0.5em;
|
98
|
-
float: left;
|
99
|
-
transition: transform 0.3s ease-in-out;
|
100
|
-
}
|
101
123
|
}
|
124
|
+
|
125
|
+
.accordionTitle:before,
|
126
|
+
.accordion__Heading:before {
|
127
|
+
content: "+";
|
128
|
+
font-size: 2.5em;
|
129
|
+
line-height: 0.5em;
|
130
|
+
float: right;
|
131
|
+
-webkit-transition: -webkit-transform 0.3s ease-in-out;
|
132
|
+
transition: -webkit-transform 0.3s ease-in-out;
|
133
|
+
transition: transform 0.3s ease-in-out;
|
134
|
+
transition: transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;
|
135
|
+
}
|
136
|
+
|
137
|
+
.accordionTitle:hover,
|
138
|
+
.accordion__Heading:hover {
|
139
|
+
background-color: #2ba659;
|
140
|
+
}
|
141
|
+
|
142
|
+
.accordionTitle:after,
|
143
|
+
.accordion__Heading:after {
|
144
|
+
content: "Q";
|
145
|
+
font-size: 2.5em;
|
146
|
+
line-height: 0.5em;
|
147
|
+
float: left;
|
148
|
+
-webkit-transition: -webkit-transform 0.3s ease-in-out;
|
149
|
+
transition: -webkit-transform 0.3s ease-in-out;
|
150
|
+
transition: transform 0.3s ease-in-out;
|
151
|
+
transition: transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;
|
152
|
+
}
|
153
|
+
|
102
|
-
.accordionTitleActive,
|
154
|
+
.accordionTitleActive,
|
103
155
|
.accordionTitle.is-expanded {
|
104
|
-
|
156
|
+
background-color: #2ba659;
|
105
|
-
&:before {
|
106
|
-
transform:rotate(-225deg);
|
107
|
-
}
|
108
157
|
}
|
158
|
+
|
159
|
+
.accordionTitleActive:before,
|
160
|
+
.accordionTitle.is-expanded:before {
|
161
|
+
-webkit-transform: rotate(-225deg);
|
162
|
+
transform: rotate(-225deg);
|
163
|
+
}
|
164
|
+
|
109
165
|
.accordionItem {
|
110
|
-
|
166
|
+
height: auto;
|
111
|
-
|
167
|
+
overflow: hidden;
|
112
|
-
//SHAME: magic number to allow the accordion to animate
|
113
|
-
|
114
|
-
|
168
|
+
max-height: 50em;
|
169
|
+
-webkit-transition: max-height 1s;
|
115
|
-
|
170
|
+
transition: max-height 1s;
|
116
|
-
|
117
|
-
|
118
|
-
@media screen and (min-width:48em) {
|
119
|
-
max-height:15em;
|
120
|
-
transition:max-height 0.5s
|
121
|
-
|
122
|
-
}
|
123
|
-
|
124
|
-
|
125
171
|
}
|
172
|
+
|
126
|
-
|
173
|
+
@media screen and (min-width: 48em) {
|
174
|
+
.accordionItem {
|
175
|
+
max-height: 15em;
|
176
|
+
-webkit-transition: max-height 0.5s;
|
177
|
+
transition: max-height 0.5s;
|
178
|
+
}
|
179
|
+
}
|
180
|
+
|
127
181
|
.accordionItem.is-collapsed {
|
128
|
-
|
182
|
+
max-height: 0;
|
129
183
|
}
|
184
|
+
|
130
185
|
.no-js .accordionItem.is-collapsed {
|
131
186
|
max-height: auto;
|
132
187
|
}
|
188
|
+
|
133
189
|
.animateIn {
|
190
|
+
-webkit-animation: accordionIn 0.45s normal ease-in-out both 1;
|
134
|
-
|
191
|
+
animation: accordionIn 0.45s normal ease-in-out both 1;
|
135
192
|
}
|
193
|
+
|
136
194
|
.animateOut {
|
195
|
+
-webkit-animation: accordionOut 0.45s alternate ease-in-out both 1;
|
137
|
-
|
196
|
+
animation: accordionOut 0.45s alternate ease-in-out both 1;
|
138
197
|
}
|
198
|
+
|
199
|
+
@-webkit-keyframes accordionIn {
|
200
|
+
0% {
|
201
|
+
opacity: 0;
|
202
|
+
-webkit-transform: scale(0.9) rotateX(-60deg);
|
203
|
+
transform: scale(0.9) rotateX(-60deg);
|
204
|
+
-webkit-transform-origin: 50% 0;
|
205
|
+
transform-origin: 50% 0;
|
206
|
+
}
|
207
|
+
100% {
|
208
|
+
opacity: 1;
|
209
|
+
-webkit-transform: scale(1);
|
210
|
+
transform: scale(1);
|
211
|
+
}
|
212
|
+
}
|
213
|
+
|
139
214
|
@keyframes accordionIn {
|
140
215
|
0% {
|
141
216
|
opacity: 0;
|
217
|
+
-webkit-transform: scale(0.9) rotateX(-60deg);
|
142
|
-
|
218
|
+
transform: scale(0.9) rotateX(-60deg);
|
219
|
+
-webkit-transform-origin: 50% 0;
|
143
|
-
|
220
|
+
transform-origin: 50% 0;
|
144
221
|
}
|
145
222
|
100% {
|
146
|
-
opacity:1;
|
223
|
+
opacity: 1;
|
224
|
+
-webkit-transform: scale(1);
|
147
|
-
|
225
|
+
transform: scale(1);
|
148
226
|
}
|
149
227
|
}
|
150
228
|
|
229
|
+
@-webkit-keyframes accordionOut {
|
230
|
+
0% {
|
231
|
+
opacity: 1;
|
232
|
+
-webkit-transform: scale(1);
|
233
|
+
transform: scale(1);
|
234
|
+
}
|
235
|
+
100% {
|
236
|
+
opacity: 0;
|
237
|
+
-webkit-transform: scale(0.9) rotateX(-60deg);
|
238
|
+
transform: scale(0.9) rotateX(-60deg);
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
151
242
|
@keyframes accordionOut {
|
152
|
-
|
243
|
+
0% {
|
153
|
-
|
244
|
+
opacity: 1;
|
245
|
+
-webkit-transform: scale(1);
|
154
|
-
|
246
|
+
transform: scale(1);
|
155
|
-
|
247
|
+
}
|
156
|
-
|
248
|
+
100% {
|
157
|
-
|
249
|
+
opacity: 0;
|
250
|
+
-webkit-transform: scale(0.9) rotateX(-60deg);
|
158
|
-
|
251
|
+
transform: scale(0.9) rotateX(-60deg);
|
159
|
-
|
252
|
+
}
|
160
253
|
}
|
161
254
|
```
|
162
255
|
```
|