質問編集履歴

13

2020/02/25 14:34

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
File without changes

12

2020/02/25 14:34

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
File without changes

11

2020/02/25 14:33

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
@@ -269,3 +269,115 @@
269
269
  }
270
270
 
271
271
  `````
272
+
273
+ ```````**JavaScript**
274
+
275
+
276
+
277
+ ``jQuery(function($){
278
+
279
+ $(document).ready(function(){
280
+
281
+
282
+
283
+
284
+
285
+ window.addEventListener('DOMContentLoaded', function() {
286
+
287
+
288
+
289
+
290
+
291
+ // グローバルメニューの固定
292
+
293
+
294
+
295
+ var navPos = jQuery( '#global-nav' ).offset().top; // グローバルメニューの位置
296
+
297
+ var navHeight = jQuery( '#global-nav' ).outerHeight(); // グローバルメニューの高さ
298
+
299
+ jQuery( window ).on( 'scroll', function() {
300
+
301
+ if ( jQuery( this ).scrollTop() > navPos ) {
302
+
303
+ jQuery( 'body' ).css( 'padding-top', navHeight );
304
+
305
+ jQuery( '#global-nav' ).addClass( 'm_fixed' );
306
+
307
+ } else {
308
+
309
+ jQuery( 'body' ).css( 'padding-top', 0 );
310
+
311
+ jQuery( '#global-nav' ).removeClass( 'm_fixed' );
312
+
313
+ }
314
+
315
+ });
316
+
317
+
318
+
319
+ var galleryThumbs = new Swiper('.swiper-navigation', {
320
+
321
+ spaceBetween: 2,
322
+
323
+ slidesPerView: 5,
324
+
325
+ watchSlidesVisibility: true,
326
+
327
+ watchSlidesProgress: true,
328
+
329
+ grabCursor: true,
330
+
331
+ slideToClickedSlide: true,
332
+
333
+ freeMode: true,
334
+
335
+  
336
+
337
+ on: {
338
+
339
+ tap: function(event) {
340
+
341
+ // 選択されてないタブをタップしたら下のスライダーを動かす
342
+
343
+ if (this.clickedIndex !== galleryThumbs.activeIndex &&
344
+
345
+ $(this.clickedSlide).data('tag') !== $(galleryThumbs.slides[galleryThumbs.activeIndex]).data('tag')
346
+
347
+ ) {
348
+
349
+ galleryThumbs.slideTo(this.clickedIndex);
350
+
351
+ }
352
+
353
+ }
354
+
355
+ }
356
+
357
+ });
358
+
359
+
360
+
361
+ var galleryTop = new Swiper('.tab-contents', {
362
+
363
+ direction: 'horizontal',
364
+
365
+ loop: false,
366
+
367
+ slideToClickedSlide: true,
368
+
369
+ thumbs: {swiper: galleryThumbs},
370
+
371
+ });
372
+
373
+
374
+
375
+ });
376
+
377
+ });
378
+
379
+ });
380
+
381
+ コード
382
+
383
+ ```

10

2020/02/25 14:00

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
@@ -268,120 +268,4 @@
268
268
 
269
269
  }
270
270
 
271
- `````````**JavaScript**
272
-
273
-
274
-
275
- ``jQuery(function($){
276
-
277
- $(document).ready(function(){
278
-
279
-
280
-
281
-
282
-
283
- window.addEventListener('DOMContentLoaded', function() {
284
-
285
-
286
-
287
-
288
-
289
- // グローバルメニューの固定
290
-
291
-
292
-
293
- var navPos = jQuery( '#global-nav' ).offset().top; // グローバルメニューの位置
294
-
295
- var navHeight = jQuery( '#global-nav' ).outerHeight(); // グローバルメニューの高さ
296
-
297
- jQuery( window ).on( 'scroll', function() {
298
-
299
- if ( jQuery( this ).scrollTop() > navPos ) {
300
-
301
- jQuery( 'body' ).css( 'padding-top', navHeight );
302
-
303
- jQuery( '#global-nav' ).addClass( 'm_fixed' );
304
-
305
- } else {
306
-
307
- jQuery( 'body' ).css( 'padding-top', 0 );
308
-
309
- jQuery( '#global-nav' ).removeClass( 'm_fixed' );
310
-
311
- }
312
-
313
- });
314
-
315
-
316
-
317
- var galleryThumbs = new Swiper('.swiper-navigation', {
318
-
319
- spaceBetween: 2,
320
-
321
- slidesPerView: 5,
322
-
323
- watchSlidesVisibility: true,
324
-
325
- watchSlidesProgress: true,
326
-
327
- grabCursor: true,
328
-
329
- slideToClickedSlide: true,
330
-
331
- freeMode: true,
332
-
333
-  
334
-
335
- on: {
336
-
337
- tap: function(event) {
338
-
339
- // 選択されてないタブをタップしたら下のスライダーを動かす
340
-
341
- if (this.clickedIndex !== galleryThumbs.activeIndex &&
342
-
343
- $(this.clickedSlide).data('tag') !== $(galleryThumbs.slides[galleryThumbs.activeIndex]).data('tag')
344
-
345
- ) {
346
-
347
- galleryThumbs.slideTo(this.clickedIndex);
348
-
349
- }
350
-
351
- }
352
-
353
- }
354
-
355
- });
356
-
357
-
358
-
359
- var galleryTop = new Swiper('.tab-contents', {
360
-
361
- direction: 'horizontal',
362
-
363
- loop: false,
364
-
365
- slideToClickedSlide: true,
366
-
367
- thumbs: {swiper: galleryThumbs},
368
-
369
- });
370
-
371
-
372
-
373
- });
374
-
375
- });
376
-
377
- });
378
-
379
- コード
380
-
381
- ```
271
+ `````
382
-
383
- ```
384
-
385
- コード
386
-
387
- ```

9

2020/02/25 14:00

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
@@ -268,6 +268,114 @@
268
268
 
269
269
  }
270
270
 
271
+ `````````**JavaScript**
272
+
273
+
274
+
275
+ ``jQuery(function($){
276
+
277
+ $(document).ready(function(){
278
+
279
+
280
+
281
+
282
+
283
+ window.addEventListener('DOMContentLoaded', function() {
284
+
285
+
286
+
287
+
288
+
289
+ // グローバルメニューの固定
290
+
291
+
292
+
293
+ var navPos = jQuery( '#global-nav' ).offset().top; // グローバルメニューの位置
294
+
295
+ var navHeight = jQuery( '#global-nav' ).outerHeight(); // グローバルメニューの高さ
296
+
297
+ jQuery( window ).on( 'scroll', function() {
298
+
299
+ if ( jQuery( this ).scrollTop() > navPos ) {
300
+
301
+ jQuery( 'body' ).css( 'padding-top', navHeight );
302
+
303
+ jQuery( '#global-nav' ).addClass( 'm_fixed' );
304
+
305
+ } else {
306
+
307
+ jQuery( 'body' ).css( 'padding-top', 0 );
308
+
309
+ jQuery( '#global-nav' ).removeClass( 'm_fixed' );
310
+
311
+ }
312
+
313
+ });
314
+
315
+
316
+
317
+ var galleryThumbs = new Swiper('.swiper-navigation', {
318
+
319
+ spaceBetween: 2,
320
+
321
+ slidesPerView: 5,
322
+
323
+ watchSlidesVisibility: true,
324
+
325
+ watchSlidesProgress: true,
326
+
327
+ grabCursor: true,
328
+
329
+ slideToClickedSlide: true,
330
+
331
+ freeMode: true,
332
+
333
+  
334
+
335
+ on: {
336
+
337
+ tap: function(event) {
338
+
339
+ // 選択されてないタブをタップしたら下のスライダーを動かす
340
+
341
+ if (this.clickedIndex !== galleryThumbs.activeIndex &&
342
+
343
+ $(this.clickedSlide).data('tag') !== $(galleryThumbs.slides[galleryThumbs.activeIndex]).data('tag')
344
+
345
+ ) {
346
+
347
+ galleryThumbs.slideTo(this.clickedIndex);
348
+
349
+ }
350
+
351
+ }
352
+
353
+ }
354
+
355
+ });
356
+
357
+
358
+
359
+ var galleryTop = new Swiper('.tab-contents', {
360
+
361
+ direction: 'horizontal',
362
+
363
+ loop: false,
364
+
365
+ slideToClickedSlide: true,
366
+
367
+ thumbs: {swiper: galleryThumbs},
368
+
369
+ });
370
+
371
+
372
+
373
+ });
374
+
375
+ });
376
+
377
+ });
378
+
271
379
  コード
272
380
 
273
381
  ```

8

2020/02/25 13:58

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
@@ -84,113 +84,189 @@
84
84
 
85
85
 
86
86
 
87
- ``````**JavaScript**
88
-
89
-
90
-
91
- ``jQuery(function($){
92
-
93
- $(document).ready(function(){
94
-
95
-
96
-
97
-
98
-
99
- window.addEventListener('DOMContentLoaded', function() {
100
-
101
-
102
-
103
-
104
-
105
- // グローバルメニューの固定
106
-
107
-
108
-
109
- var navPos = jQuery( '#global-nav' ).offset().top; // グローバルメニューの位置
110
-
111
- var navHeight = jQuery( '#global-nav' ).outerHeight(); // グローバルメニューの高さ
112
-
113
- jQuery( window ).on( 'scroll', function() {
114
-
115
- if ( jQuery( this ).scrollTop() > navPos ) {
116
-
117
- jQuery( 'body' ).css( 'padding-top', navHeight );
118
-
119
- jQuery( '#global-nav' ).addClass( 'm_fixed' );
120
-
121
- } else {
122
-
123
- jQuery( 'body' ).css( 'padding-top', 0 );
124
-
125
- jQuery( '#global-nav' ).removeClass( 'm_fixed' );
126
-
127
- }
128
-
129
- });
130
-
131
-
132
-
133
- var galleryThumbs = new Swiper('.swiper-navigation', {
134
-
135
- spaceBetween: 2,
136
-
137
- slidesPerView: 5,
138
-
139
- watchSlidesVisibility: true,
140
-
141
- watchSlidesProgress: true,
142
-
143
- grabCursor: true,
144
-
145
- slideToClickedSlide: true,
146
-
147
- freeMode: true,
148
-
149
-  
150
-
151
- on: {
152
-
153
- tap: function(event) {
154
-
155
- // 選択されてないタブをタップしたら下のスライダーを動かす
156
-
157
- if (this.clickedIndex !== galleryThumbs.activeIndex &&
158
-
159
- $(this.clickedSlide).data('tag') !== $(galleryThumbs.slides[galleryThumbs.activeIndex]).data('tag')
160
-
161
- ) {
162
-
163
- galleryThumbs.slideTo(this.clickedIndex);
164
-
165
- }
166
-
167
- }
168
-
169
- }
170
-
171
- });
172
-
173
-
174
-
175
- var galleryTop = new Swiper('.tab-contents', {
176
-
177
- direction: 'horizontal',
178
-
179
- loop: false,
180
-
181
- slideToClickedSlide: true,
182
-
183
- thumbs: {swiper: galleryThumbs},
184
-
185
- });
186
-
187
-
188
-
189
- });
190
-
191
- });
192
-
193
- });
87
+
88
+
89
+ body{
90
+
91
+
92
+
93
+ }
94
+
95
+
96
+
97
+ .contener1{
98
+
99
+ width: auto;
100
+
101
+ margin-left:2%;
102
+
103
+ }
104
+
105
+
106
+
107
+ global-nav {
108
+
109
+
110
+
111
+ width: auto;
112
+
113
+ height: 40px;
114
+
115
+ margin-left:0%;
116
+
117
+ background: #fff;
118
+
119
+ width: 100%;
120
+
121
+ z-index:999;
122
+
123
+ }
124
+
125
+
126
+
127
+ global-nav.m_fixed {
128
+
129
+
130
+
131
+ left: 0;
132
+
133
+ position: fixed;
134
+
135
+ top: 0;
136
+
137
+ }
138
+
139
+
140
+
141
+ .swiper-container {
142
+
143
+ margin: 0 auto 30px;
144
+
145
+ }
146
+
147
+
148
+
149
+ /* 下線*/
150
+
151
+ .swiper-navigation {
152
+
153
+ width: auto;
154
+
155
+ border-bottom:2px solid #e6e6e6;
156
+
157
+
158
+
159
+ }
160
+
161
+ .swiper-slide-thumb-active {
162
+
163
+ transform:translateX(-50%)
164
+
165
+ opacity: .7;
166
+
167
+ background-color: rgb(242, 56, 121) !important;
168
+
169
+ border-bottom: 10px solid rgb(242, 56, 121) !important;
170
+
171
+ color: rgb(250,250, 250) !important;
172
+
173
+ font-weight: bold;
174
+
175
+
176
+
177
+ }
178
+
179
+
180
+
181
+ /* タブ*/
182
+
183
+ .swiper-navigation .swiper-slide{
184
+
185
+ /* widthに100%を4で割る指定*/
186
+
187
+ content:"";
188
+
189
+ text-align: center;
190
+
191
+ width: auto;
192
+
193
+
194
+
195
+ height: 35px;
196
+
197
+ line-height:40px;
198
+
199
+ background-color: #a7f2e4;
200
+
201
+ font-weight: bold;
202
+
203
+ font-size: calc(70% + 0.12vw)
204
+
205
+ }
206
+
207
+
208
+
209
+ /* タブの色の濃さ さわらない*/
210
+
211
+ .tab-menu .swiper-slide {
212
+
213
+ cursor: pointer;
214
+
215
+ opacity: .7;
216
+
217
+ }
218
+
219
+
220
+
221
+ .swiper-navigation .swiper-wrapper{
222
+
223
+
224
+
225
+ /* タブからコンテンツの距離 */
226
+
227
+ height:40px;
228
+
229
+ }
230
+
231
+
232
+
233
+ /* コンテンツ */
234
+
235
+
236
+
237
+ .tab-contens{
238
+
239
+ background-color: #dcdcdc;
240
+
241
+ text-align: center;
242
+
243
+ margin-left:2%;
244
+
245
+ }
246
+
247
+
248
+
249
+ .tab-contens div a{
250
+
251
+ display: table;
252
+
253
+ width: 100%;
254
+
255
+ text-decoration: none;
256
+
257
+ padding: 10px; !important;
258
+
259
+ border-bottom:1px solid #000;
260
+
261
+ color:#222; !important;
262
+
263
+ text-align: left;
264
+
265
+ line-height: 1.5em;
266
+
267
+ font-size: 14px;
268
+
269
+ }
194
270
 
195
271
  コード
196
272
 
@@ -198,196 +274,6 @@
198
274
 
199
275
  ```
200
276
 
201
-
202
-
203
- body{
204
-
205
-
206
-
207
- }
208
-
209
-
210
-
211
- .contener1{
212
-
213
- width: auto;
214
-
215
- margin-left:2%;
216
-
217
- }
218
-
219
-
220
-
221
- global-nav {
222
-
223
-
224
-
225
- width: auto;
226
-
227
- height: 40px;
228
-
229
- margin-left:0%;
230
-
231
- background: #fff;
232
-
233
- width: 100%;
234
-
235
- z-index:999;
236
-
237
- }
238
-
239
-
240
-
241
- global-nav.m_fixed {
242
-
243
-
244
-
245
- left: 0;
246
-
247
- position: fixed;
248
-
249
- top: 0;
250
-
251
- }
252
-
253
-
254
-
255
- .swiper-container {
256
-
257
- margin: 0 auto 30px;
258
-
259
- }
260
-
261
-
262
-
263
- /* 下線*/
264
-
265
- .swiper-navigation {
266
-
267
- width: auto;
268
-
269
- border-bottom:2px solid #e6e6e6;
270
-
271
-
272
-
273
- }
274
-
275
- .swiper-slide-thumb-active {
276
-
277
- transform:translateX(-50%)
278
-
279
- opacity: .7;
280
-
281
- background-color: rgb(242, 56, 121) !important;
282
-
283
- border-bottom: 10px solid rgb(242, 56, 121) !important;
284
-
285
- color: rgb(250,250, 250) !important;
286
-
287
- font-weight: bold;
288
-
289
-
290
-
291
- }
292
-
293
-
294
-
295
- /* タブ*/
296
-
297
- .swiper-navigation .swiper-slide{
298
-
299
- /* widthに100%を4で割る指定*/
300
-
301
- content:"";
302
-
303
- text-align: center;
304
-
305
- width: auto;
306
-
307
-
308
-
309
- height: 35px;
310
-
311
- line-height:40px;
312
-
313
- background-color: #a7f2e4;
314
-
315
- font-weight: bold;
316
-
317
- font-size: calc(70% + 0.12vw)
318
-
319
- }
320
-
321
-
322
-
323
- /* タブの色の濃さ さわらない*/
324
-
325
- .tab-menu .swiper-slide {
326
-
327
- cursor: pointer;
328
-
329
- opacity: .7;
330
-
331
- }
332
-
333
-
334
-
335
- .swiper-navigation .swiper-wrapper{
336
-
337
-
338
-
339
- /* タブからコンテンツの距離 */
340
-
341
- height:40px;
342
-
343
- }
344
-
345
-
346
-
347
- /* コンテンツ */
348
-
349
-
350
-
351
- .tab-contens{
352
-
353
- background-color: #dcdcdc;
354
-
355
- text-align: center;
356
-
357
- margin-left:2%;
358
-
359
- }
360
-
361
-
362
-
363
- .tab-contens div a{
364
-
365
- display: table;
366
-
367
- width: 100%;
368
-
369
- text-decoration: none;
370
-
371
- padding: 10px; !important;
372
-
373
- border-bottom:1px solid #000;
374
-
375
- color:#222; !important;
376
-
377
- text-align: left;
378
-
379
- line-height: 1.5em;
380
-
381
- font-size: 14px;
382
-
383
- }
384
-
385
277
  コード
386
278
 
387
279
  ```
388
-
389
- ```
390
-
391
- コード
392
-
393
- ```

7

2020/02/25 13:56

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
@@ -84,7 +84,119 @@
84
84
 
85
85
 
86
86
 
87
- ```**css**
87
+ ``````**JavaScript**
88
+
89
+
90
+
91
+ ``jQuery(function($){
92
+
93
+ $(document).ready(function(){
94
+
95
+
96
+
97
+
98
+
99
+ window.addEventListener('DOMContentLoaded', function() {
100
+
101
+
102
+
103
+
104
+
105
+ // グローバルメニューの固定
106
+
107
+
108
+
109
+ var navPos = jQuery( '#global-nav' ).offset().top; // グローバルメニューの位置
110
+
111
+ var navHeight = jQuery( '#global-nav' ).outerHeight(); // グローバルメニューの高さ
112
+
113
+ jQuery( window ).on( 'scroll', function() {
114
+
115
+ if ( jQuery( this ).scrollTop() > navPos ) {
116
+
117
+ jQuery( 'body' ).css( 'padding-top', navHeight );
118
+
119
+ jQuery( '#global-nav' ).addClass( 'm_fixed' );
120
+
121
+ } else {
122
+
123
+ jQuery( 'body' ).css( 'padding-top', 0 );
124
+
125
+ jQuery( '#global-nav' ).removeClass( 'm_fixed' );
126
+
127
+ }
128
+
129
+ });
130
+
131
+
132
+
133
+ var galleryThumbs = new Swiper('.swiper-navigation', {
134
+
135
+ spaceBetween: 2,
136
+
137
+ slidesPerView: 5,
138
+
139
+ watchSlidesVisibility: true,
140
+
141
+ watchSlidesProgress: true,
142
+
143
+ grabCursor: true,
144
+
145
+ slideToClickedSlide: true,
146
+
147
+ freeMode: true,
148
+
149
+  
150
+
151
+ on: {
152
+
153
+ tap: function(event) {
154
+
155
+ // 選択されてないタブをタップしたら下のスライダーを動かす
156
+
157
+ if (this.clickedIndex !== galleryThumbs.activeIndex &&
158
+
159
+ $(this.clickedSlide).data('tag') !== $(galleryThumbs.slides[galleryThumbs.activeIndex]).data('tag')
160
+
161
+ ) {
162
+
163
+ galleryThumbs.slideTo(this.clickedIndex);
164
+
165
+ }
166
+
167
+ }
168
+
169
+ }
170
+
171
+ });
172
+
173
+
174
+
175
+ var galleryTop = new Swiper('.tab-contents', {
176
+
177
+ direction: 'horizontal',
178
+
179
+ loop: false,
180
+
181
+ slideToClickedSlide: true,
182
+
183
+ thumbs: {swiper: galleryThumbs},
184
+
185
+ });
186
+
187
+
188
+
189
+ });
190
+
191
+ });
192
+
193
+ });
194
+
195
+ コード
196
+
197
+ ```
198
+
199
+ ```
88
200
 
89
201
 
90
202
 
@@ -96,47 +208,45 @@
96
208
 
97
209
 
98
210
 
99
-
100
-
101
-
102
-
103
211
  .contener1{
104
212
 
105
- width: auto;
213
+ width: auto;
106
-
214
+
107
- margin-left:2%;
215
+ margin-left:2%;
108
-
216
+
109
- }
217
+ }
110
-
111
-
112
-
113
-
114
-
218
+
219
+
220
+
115
- #global-nav {
221
+ global-nav {
116
-
222
+
223
+
224
+
117
- width: auto;
225
+ width: auto;
118
-
226
+
119
- height: 40px;
227
+ height: 40px;
120
-
228
+
121
- margin-left:0%;
229
+ margin-left:0%;
122
-
230
+
123
- background: #fff;
231
+ background: #fff;
124
-
232
+
125
- width: 100%;
233
+ width: 100%;
126
-
234
+
127
- z-index:999;
235
+ z-index:999;
128
-
236
+
129
- }
237
+ }
130
-
131
-
132
-
238
+
239
+
240
+
133
- #global-nav.m_fixed {
241
+ global-nav.m_fixed {
134
-
242
+
243
+
244
+
135
- left: 0;
245
+ left: 0;
136
-
246
+
137
- position: fixed;
247
+ position: fixed;
138
-
248
+
139
- top: 0;
249
+ top: 0;
140
250
 
141
251
  }
142
252
 
@@ -144,7 +254,7 @@
144
254
 
145
255
  .swiper-container {
146
256
 
147
- margin: 0 auto 30px;
257
+ margin: 0 auto 30px;
148
258
 
149
259
  }
150
260
 
@@ -154,33 +264,31 @@
154
264
 
155
265
  .swiper-navigation {
156
266
 
157
- width: auto;
267
+ width: auto;
158
-
268
+
159
- border-bottom:2px solid #e6e6e6;
269
+ border-bottom:2px solid #e6e6e6;
160
-
161
-
162
-
270
+
271
+
272
+
163
- }
273
+ }
164
-
274
+
165
- .swiper-slide-thumb-active {
275
+ .swiper-slide-thumb-active {
166
-
276
+
167
-  transform:translateX(-50%)
277
+ transform:translateX(-50%)
168
-
278
+
169
- opacity: .7;
279
+ opacity: .7;
170
-
280
+
171
- background-color: rgb(242, 56, 121) !important;
281
+ background-color: rgb(242, 56, 121) !important;
172
-
282
+
173
- border-bottom: 10px solid rgb(242, 56, 121) !important;
283
+ border-bottom: 10px solid rgb(242, 56, 121) !important;
174
-
284
+
175
- color: rgb(250,250, 250) !important;
285
+ color: rgb(250,250, 250) !important;
176
-
286
+
177
- font-weight: bold;
287
+ font-weight: bold;
178
-
179
-
180
-
288
+
289
+
290
+
181
- }
291
+ }
182
-
183
-
184
292
 
185
293
 
186
294
 
@@ -188,25 +296,25 @@
188
296
 
189
297
  .swiper-navigation .swiper-slide{
190
298
 
191
- /* widthに100%を4で割る指定*/
299
+ /* widthに100%を4で割る指定*/
192
-
300
+
193
-  content:"";
301
+ content:"";
194
-
302
+
195
- text-align: center;
303
+ text-align: center;
196
-
304
+
197
- width: auto;
305
+ width: auto;
198
-
199
-
200
-
306
+
307
+
308
+
201
- height: 35px;
309
+ height: 35px;
202
-
310
+
203
- line-height:40px;
311
+ line-height:40px;
204
-
312
+
205
- background-color: #a7f2e4;
313
+ background-color: #a7f2e4;
206
-
314
+
207
- font-weight: bold;
315
+ font-weight: bold;
208
-
316
+
209
- font-size: calc(70% + 0.12vw)
317
+ font-size: calc(70% + 0.12vw)
210
318
 
211
319
  }
212
320
 
@@ -216,9 +324,9 @@
216
324
 
217
325
  .tab-menu .swiper-slide {
218
326
 
219
- cursor: pointer;
327
+ cursor: pointer;
220
-
328
+
221
- opacity: .7;
329
+ opacity: .7;
222
330
 
223
331
  }
224
332
 
@@ -230,11 +338,9 @@
230
338
 
231
339
  /* タブからコンテンツの距離 */
232
340
 
233
- height:40px;
341
+ height:40px;
234
-
342
+
235
- }
343
+ }
236
-
237
-
238
344
 
239
345
 
240
346
 
@@ -244,156 +350,44 @@
244
350
 
245
351
  .tab-contens{
246
352
 
247
- background-color: #dcdcdc;
353
+ background-color: #dcdcdc;
248
-
354
+
249
- text-align: center;
355
+ text-align: center;
250
-
356
+
251
- margin-left:2%;
357
+ margin-left:2%;
252
-
358
+
253
- }
359
+ }
254
-
255
-
256
360
 
257
361
 
258
362
 
259
363
  .tab-contens div a{
260
364
 
261
- display: table;
365
+ display: table;
262
-
366
+
263
- width: 100%;
367
+ width: 100%;
264
-
368
+
265
- text-decoration: none;
369
+ text-decoration: none;
266
-
370
+
267
- padding: 10px; !important;
371
+ padding: 10px; !important;
268
-
372
+
269
- border-bottom:1px solid #000;
373
+ border-bottom:1px solid #000;
270
-
374
+
271
- color:#222; !important;
375
+ color:#222; !important;
272
-
376
+
273
- text-align: left;
377
+ text-align: left;
274
-
378
+
275
- line-height: 1.5em;
379
+ line-height: 1.5em;
276
-
380
+
277
- font-size: 14px;
381
+ font-size: 14px;
278
-
382
+
279
- }
383
+ }
280
-
281
- ``````**JavaScript**
282
-
283
-
284
-
285
- ``jQuery(function($){
286
-
287
- $(document).ready(function(){
288
-
289
-
290
-
291
-
292
-
293
- window.addEventListener('DOMContentLoaded', function() {
294
-
295
-
296
-
297
-
298
-
299
- // グローバルメニューの固定
300
-
301
-
302
-
303
- var navPos = jQuery( '#global-nav' ).offset().top; // グローバルメニューの位置
304
-
305
- var navHeight = jQuery( '#global-nav' ).outerHeight(); // グローバルメニューの高さ
306
-
307
- jQuery( window ).on( 'scroll', function() {
308
-
309
- if ( jQuery( this ).scrollTop() > navPos ) {
310
-
311
- jQuery( 'body' ).css( 'padding-top', navHeight );
312
-
313
- jQuery( '#global-nav' ).addClass( 'm_fixed' );
314
-
315
- } else {
316
-
317
- jQuery( 'body' ).css( 'padding-top', 0 );
318
-
319
- jQuery( '#global-nav' ).removeClass( 'm_fixed' );
320
-
321
- }
322
-
323
- });
324
-
325
-
326
-
327
- var galleryThumbs = new Swiper('.swiper-navigation', {
328
-
329
- spaceBetween: 2,
330
-
331
- slidesPerView: 5,
332
-
333
- watchSlidesVisibility: true,
334
-
335
- watchSlidesProgress: true,
336
-
337
- grabCursor: true,
338
-
339
- slideToClickedSlide: true,
340
-
341
- freeMode: true,
342
-
343
-  
344
-
345
- on: {
346
-
347
- tap: function(event) {
348
-
349
- // 選択されてないタブをタップしたら下のスライダーを動かす
350
-
351
- if (this.clickedIndex !== galleryThumbs.activeIndex &&
352
-
353
- $(this.clickedSlide).data('tag') !== $(galleryThumbs.slides[galleryThumbs.activeIndex]).data('tag')
354
-
355
- ) {
356
-
357
- galleryThumbs.slideTo(this.clickedIndex);
358
-
359
- }
360
-
361
- }
362
-
363
- }
364
-
365
- });
366
-
367
-
368
-
369
- var galleryTop = new Swiper('.tab-contents', {
370
-
371
- direction: 'horizontal',
372
-
373
- loop: false,
374
-
375
- slideToClickedSlide: true,
376
-
377
- thumbs: {swiper: galleryThumbs},
378
-
379
- });
380
-
381
-
382
-
383
- });
384
-
385
- });
386
-
387
- });
388
384
 
389
385
  コード
390
386
 
391
387
  ```
392
388
 
389
+ ```
390
+
393
391
  コード
394
392
 
395
393
  ```
396
-
397
- コード
398
-
399
- ```

6

2020/02/25 13:55

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
@@ -82,7 +82,203 @@
82
82
 
83
83
  </div>
84
84
 
85
+
86
+
87
+ ```**css**
88
+
89
+
90
+
91
+ body{
92
+
93
+
94
+
95
+ }
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ .contener1{
104
+
105
+ width: auto;
106
+
107
+ margin-left:2%;
108
+
109
+ }
110
+
111
+
112
+
113
+
114
+
115
+ #global-nav {
116
+
117
+ width: auto;
118
+
119
+ height: 40px;
120
+
121
+ margin-left:0%;
122
+
123
+ background: #fff;
124
+
125
+ width: 100%;
126
+
127
+ z-index:999;
128
+
129
+ }
130
+
131
+
132
+
133
+ #global-nav.m_fixed {
134
+
135
+ left: 0;
136
+
137
+ position: fixed;
138
+
139
+ top: 0;
140
+
141
+ }
142
+
143
+
144
+
145
+ .swiper-container {
146
+
147
+ margin: 0 auto 30px;
148
+
149
+ }
150
+
151
+
152
+
153
+ /* 下線*/
154
+
155
+ .swiper-navigation {
156
+
157
+ width: auto;
158
+
159
+ border-bottom:2px solid #e6e6e6;
160
+
161
+
162
+
163
+ }
164
+
165
+ .swiper-slide-thumb-active {
166
+
167
+  transform:translateX(-50%)
168
+
169
+ opacity: .7;
170
+
171
+ background-color: rgb(242, 56, 121) !important;
172
+
173
+ border-bottom: 10px solid rgb(242, 56, 121) !important;
174
+
175
+ color: rgb(250,250, 250) !important;
176
+
177
+ font-weight: bold;
178
+
179
+
180
+
181
+ }
182
+
183
+
184
+
185
+
186
+
187
+ /* タブ*/
188
+
189
+ .swiper-navigation .swiper-slide{
190
+
191
+ /* widthに100%を4で割る指定*/
192
+
193
+  content:"";
194
+
195
+ text-align: center;
196
+
197
+ width: auto;
198
+
199
+
200
+
201
+ height: 35px;
202
+
203
+ line-height:40px;
204
+
205
+ background-color: #a7f2e4;
206
+
207
+ font-weight: bold;
208
+
209
+ font-size: calc(70% + 0.12vw)
210
+
211
+ }
212
+
213
+
214
+
215
+ /* タブの色の濃さ さわらない*/
216
+
217
+ .tab-menu .swiper-slide {
218
+
219
+ cursor: pointer;
220
+
221
+ opacity: .7;
222
+
223
+ }
224
+
225
+
226
+
227
+ .swiper-navigation .swiper-wrapper{
228
+
229
+
230
+
231
+ /* タブからコンテンツの距離 */
232
+
233
+ height:40px;
234
+
235
+ }
236
+
237
+
238
+
239
+
240
+
241
+ /* コンテンツ */
242
+
243
+
244
+
245
+ .tab-contens{
246
+
247
+ background-color: #dcdcdc;
248
+
249
+ text-align: center;
250
+
251
+ margin-left:2%;
252
+
253
+ }
254
+
255
+
256
+
257
+
258
+
259
+ .tab-contens div a{
260
+
261
+ display: table;
262
+
263
+ width: 100%;
264
+
265
+ text-decoration: none;
266
+
267
+ padding: 10px; !important;
268
+
269
+ border-bottom:1px solid #000;
270
+
271
+ color:#222; !important;
272
+
273
+ text-align: left;
274
+
275
+ line-height: 1.5em;
276
+
277
+ font-size: 14px;
278
+
279
+ }
280
+
85
- ```**JavaScript**
281
+ ``````**JavaScript**
86
282
 
87
283
 
88
284
 
@@ -190,206 +386,10 @@
190
386
 
191
387
  });
192
388
 
193
-
194
-
195
- ```**css**
196
-
197
-
198
-
199
- body{
200
-
201
-
202
-
203
- }
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
- .contener1{
212
-
213
- width: auto;
214
-
215
- margin-left:2%;
216
-
217
- }
218
-
219
-
220
-
221
-
222
-
223
- #global-nav {
224
-
225
- width: auto;
226
-
227
- height: 40px;
228
-
229
- margin-left:0%;
230
-
231
- background: #fff;
232
-
233
- width: 100%;
234
-
235
- z-index:999;
236
-
237
- }
238
-
239
-
240
-
241
- #global-nav.m_fixed {
242
-
243
- left: 0;
244
-
245
- position: fixed;
246
-
247
- top: 0;
248
-
249
- }
250
-
251
-
252
-
253
- .swiper-container {
254
-
255
- margin: 0 auto 30px;
256
-
257
- }
258
-
259
-
260
-
261
- /* 下線*/
262
-
263
- .swiper-navigation {
264
-
265
- width: auto;
266
-
267
- border-bottom:2px solid #e6e6e6;
268
-
269
-
270
-
271
- }
272
-
273
- .swiper-slide-thumb-active {
274
-
275
-  transform:translateX(-50%)
276
-
277
- opacity: .7;
278
-
279
- background-color: rgb(242, 56, 121) !important;
280
-
281
- border-bottom: 10px solid rgb(242, 56, 121) !important;
282
-
283
- color: rgb(250,250, 250) !important;
284
-
285
- font-weight: bold;
286
-
287
-
288
-
289
- }
290
-
291
-
292
-
293
-
294
-
295
- /* タブ*/
296
-
297
- .swiper-navigation .swiper-slide{
298
-
299
- /* widthに100%を4で割る指定*/
300
-
301
-  content:"";
302
-
303
- text-align: center;
304
-
305
- width: auto;
306
-
307
-
308
-
309
- height: 35px;
310
-
311
- line-height:40px;
312
-
313
- background-color: #a7f2e4;
314
-
315
- font-weight: bold;
316
-
317
- font-size: calc(70% + 0.12vw)
318
-
319
- }
320
-
321
-
322
-
323
- /* タブの色の濃さ さわらない*/
324
-
325
- .tab-menu .swiper-slide {
326
-
327
- cursor: pointer;
328
-
329
- opacity: .7;
330
-
331
- }
332
-
333
- ```ここに言語を入力
334
-
335
389
  コード
336
390
 
337
391
  ```
338
392
 
339
- .swiper-navigation .swiper-wrapper{
340
-
341
-
342
-
343
- /* タブからコンテンツの距離 */
344
-
345
- height:40px;
346
-
347
- }
348
-
349
-
350
-
351
-
352
-
353
- /* コンテンツ */
354
-
355
-
356
-
357
- .tab-contens{
358
-
359
- background-color: #dcdcdc;
360
-
361
- text-align: center;
362
-
363
- margin-left:2%;
364
-
365
- }
366
-
367
-
368
-
369
-
370
-
371
- .tab-contens div a{
372
-
373
- display: table;
374
-
375
- width: 100%;
376
-
377
- text-decoration: none;
378
-
379
- padding: 10px; !important;
380
-
381
- border-bottom:1px solid #000;
382
-
383
- color:#222; !important;
384
-
385
- text-align: left;
386
-
387
- line-height: 1.5em;
388
-
389
- font-size: 14px;
390
-
391
- }
392
-
393
393
  コード
394
394
 
395
395
  ```

5

2020/02/25 13:51

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
@@ -14,129 +14,381 @@
14
14
 
15
15
 
16
16
 
17
- 4番目6番目を押した時にセンターに
17
+ 4番目から6番目を押した時にセンターに表示したいです。
18
-
19
-
20
-
18
+
19
+
20
+
21
+
22
+
21
- 移動したい
23
+ 今現地のものです
24
+
25
+
26
+
22
-
27
+ **html**
28
+
23
-
29
+ ```<div class="container1">
30
+
31
+ <nav id="global-nav">
32
+
33
+ <div class="swiper-container swiper-navigation">
34
+
35
+ <div class="swiper-wrapper">
36
+
37
+ <div class="swiper-slide" data-type="article active" data-tag="ボックス1"></div>
38
+
39
+ <div class="swiper-slide" data-type="article" data-tag="ボックス2"></div>
40
+
41
+ <div class="swiper-slide" data-type="article" data-tag="ボックス3"></div>
42
+
43
+ <div class="swiper-slide" data-type="article" data-tag="ボックス4"></div>
44
+
45
+ <div class="swiper-slide" data-type="article" data-tag="ボックス5"></div>
46
+
47
+ <div class="swiper-slide" data-type="article" data-tag="ボックス6"></div>
48
+
49
+ <div class="swiper-slide" data-type="article" data-tag="ボックス7"></div>
50
+
51
+ <div class="swiper-slide" data-type="article" data-tag="ボックス8"></div>
52
+
53
+ </div>
54
+
55
+ <div class="swiper-pagination"></div>
56
+
57
+ </div>
58
+
59
+ </div>
60
+
61
+ <div class="swiper-container tab-contents">
62
+
63
+ <div class="swiper-wrapper">
64
+
65
+ <div class="swiper-slide">ボックス9</div>
66
+
67
+   <div class="swiper-slide">ボックス10</div>
68
+
69
+ <div class="swiper-slide">ボックス11</div>
70
+
71
+ <div class="swiper-slide">ボックス12</div>
72
+
73
+ <div class="swiper-slide">ボックス13</div>
74
+
75
+    <div class="swiper-slide">ボックス14</div>
76
+
77
+ <div class="swiper-slide">ボックス15</div>
78
+
79
+ <div class="swiper-slide">ボックス16</div>
80
+
81
+ </div>
82
+
83
+ </div>
84
+
85
+ ```**JavaScript**
86
+
87
+
88
+
89
+ ``jQuery(function($){
90
+
91
+ $(document).ready(function(){
92
+
93
+
94
+
95
+
96
+
97
+ window.addEventListener('DOMContentLoaded', function() {
98
+
99
+
100
+
101
+
102
+
103
+ // グローバルメニューの固定
104
+
105
+
106
+
107
+ var navPos = jQuery( '#global-nav' ).offset().top; // グローバルメニューの位置
108
+
109
+ var navHeight = jQuery( '#global-nav' ).outerHeight(); // グローバルメニューの高さ
110
+
111
+ jQuery( window ).on( 'scroll', function() {
112
+
113
+ if ( jQuery( this ).scrollTop() > navPos ) {
114
+
115
+ jQuery( 'body' ).css( 'padding-top', navHeight );
116
+
117
+ jQuery( '#global-nav' ).addClass( 'm_fixed' );
118
+
119
+ } else {
120
+
121
+ jQuery( 'body' ).css( 'padding-top', 0 );
122
+
123
+ jQuery( '#global-nav' ).removeClass( 'm_fixed' );
124
+
125
+ }
126
+
127
+ });
128
+
129
+
130
+
131
+ var galleryThumbs = new Swiper('.swiper-navigation', {
132
+
133
+ spaceBetween: 2,
134
+
135
+ slidesPerView: 5,
136
+
137
+ watchSlidesVisibility: true,
138
+
139
+ watchSlidesProgress: true,
140
+
141
+ grabCursor: true,
142
+
143
+ slideToClickedSlide: true,
144
+
145
+ freeMode: true,
146
+
147
+  
148
+
149
+ on: {
150
+
151
+ tap: function(event) {
152
+
153
+ // 選択されてないタブをタップしたら下のスライダーを動かす
154
+
155
+ if (this.clickedIndex !== galleryThumbs.activeIndex &&
156
+
157
+ $(this.clickedSlide).data('tag') !== $(galleryThumbs.slides[galleryThumbs.activeIndex]).data('tag')
158
+
159
+ ) {
160
+
161
+ galleryThumbs.slideTo(this.clickedIndex);
162
+
163
+ }
164
+
165
+ }
166
+
167
+ }
168
+
169
+ });
170
+
171
+
172
+
173
+ var galleryTop = new Swiper('.tab-contents', {
174
+
175
+ direction: 'horizontal',
176
+
177
+ loop: false,
178
+
179
+ slideToClickedSlide: true,
180
+
181
+ thumbs: {swiper: galleryThumbs},
182
+
183
+ });
184
+
185
+
186
+
187
+ });
188
+
189
+ });
190
+
191
+ });
192
+
193
+
194
+
195
+ ```**css**
196
+
197
+
198
+
199
+ body{
200
+
201
+
202
+
203
+ }
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+ .contener1{
212
+
213
+ width: auto;
214
+
215
+ margin-left:2%;
216
+
217
+ }
218
+
219
+
220
+
221
+
222
+
223
+ #global-nav {
224
+
225
+ width: auto;
226
+
227
+ height: 40px;
228
+
229
+ margin-left:0%;
230
+
231
+ background: #fff;
232
+
233
+ width: 100%;
234
+
235
+ z-index:999;
236
+
237
+ }
238
+
239
+
240
+
241
+ #global-nav.m_fixed {
242
+
243
+ left: 0;
244
+
245
+ position: fixed;
246
+
247
+ top: 0;
248
+
249
+ }
250
+
251
+
252
+
253
+ .swiper-container {
254
+
255
+ margin: 0 auto 30px;
256
+
257
+ }
258
+
259
+
260
+
261
+ /* 下線*/
262
+
263
+ .swiper-navigation {
264
+
265
+ width: auto;
266
+
267
+ border-bottom:2px solid #e6e6e6;
268
+
269
+
270
+
271
+ }
272
+
273
+ .swiper-slide-thumb-active {
274
+
275
+  transform:translateX(-50%)
276
+
277
+ opacity: .7;
278
+
279
+ background-color: rgb(242, 56, 121) !important;
280
+
281
+ border-bottom: 10px solid rgb(242, 56, 121) !important;
282
+
283
+ color: rgb(250,250, 250) !important;
284
+
285
+ font-weight: bold;
286
+
287
+
288
+
289
+ }
290
+
291
+
292
+
293
+
294
+
295
+ /* タブ*/
296
+
297
+ .swiper-navigation .swiper-slide{
298
+
299
+ /* widthに100%を4で割る指定*/
300
+
301
+  content:"";
302
+
303
+ text-align: center;
304
+
305
+ width: auto;
306
+
307
+
308
+
309
+ height: 35px;
310
+
311
+ line-height:40px;
312
+
313
+ background-color: #a7f2e4;
314
+
315
+ font-weight: bold;
316
+
317
+ font-size: calc(70% + 0.12vw)
318
+
319
+ }
320
+
321
+
322
+
323
+ /* タブの色の濃さ さわらない*/
324
+
325
+ .tab-menu .swiper-slide {
326
+
327
+ cursor: pointer;
328
+
329
+ opacity: .7;
330
+
331
+ }
332
+
333
+ ```ここに言語を入力
334
+
335
+ コード
24
336
 
25
337
  ```
26
338
 
27
- <div class="container">
28
-
29
- <!-- Swiper -->
30
-
31
- <div class="swiper-container tab-menu">
32
-
33
- <div class="swiper-wrapper">
34
-
35
- <div class="swiper-slide">トップ</div>
36
-
37
- <div class="swiper-slide">ランキング</div>
38
-
39
- <div class="swiper-slide">国内</div>
40
-
41
- <div class="swiper-slide">エンタメ</div>
42
-
43
- <div class="swiper-slide">スポーツ</div>
44
-
45
- <div class="swiper-slide">経済</div>
46
-
47
-
48
-
49
- <div class="swiper-slide">グルメ</div>
50
-
51
-
52
-
53
- <div class="swiper-slide">sns
54
-
55
- </div>
56
-
57
-
58
-
59
- </div>
60
-
61
- </div>
62
-
63
- <div class="swiper-container tab-contents">
64
-
65
- <div class="swiper-wrapper">
66
-
67
- <div class="swiper-slide">トップ</div>
68
-
69
- <div class="swiper-slide">ランキング</div>
70
-
71
- <div class="swiper-slide">国内</div>
72
-
73
- <div class="swiper-slide">エンタメ</div>
74
-
75
- <div class="swiper-slide">スポーツ</div>
76
-
77
- <div class="swiper-slide">経済</div>
78
-
79
-
80
-
81
- <div class="swiper-slide">グルメ</div>
82
-
83
-
84
-
85
- <div class="swiper-slide">sns
86
-
87
- </div>
88
-
89
-
90
-
91
- </div>
92
-
93
- </div>
94
-
95
- </div>
96
-
97
-
98
-
99
-
100
-
101
- ```<script>
102
-
103
- var galleryThumbs = new Swiper('.tab-menu', {
104
-
105
- spaceBetween: 20,
106
-
107
- slidesPerView: 'auto',
108
-
109
- watchSlidesVisibility: true,
110
-
111
- watchSlidesProgress: true,
112
-
113
- slideActiveClass: 'swiper-slide-active'
114
-
115
- });
116
-
117
- galleryThumbs.on('tap', function () {
118
-
119
- var current = galleryTop.activeIndex;
120
-
121
- galleryThumbs.slideTo(current, 500, true);
122
-
123
- });
124
-
125
- var galleryTop = new Swiper('.tab-contents', {
126
-
127
- autoHeight: true,
128
-
129
- thumbs: {
130
-
131
- swiper: galleryThumbs
132
-
133
- }
134
-
135
- });
136
-
137
- </script>
138
-
139
- ```ここに言語を入力
339
+ .swiper-navigation .swiper-wrapper{
340
+
341
+
342
+
343
+ /* タブからコンテンツの距離 */
344
+
345
+ height:40px;
346
+
347
+ }
348
+
349
+
350
+
351
+
352
+
353
+ /* コンテンツ */
354
+
355
+
356
+
357
+ .tab-contens{
358
+
359
+ background-color: #dcdcdc;
360
+
361
+ text-align: center;
362
+
363
+ margin-left:2%;
364
+
365
+ }
366
+
367
+
368
+
369
+
370
+
371
+ .tab-contens div a{
372
+
373
+ display: table;
374
+
375
+ width: 100%;
376
+
377
+ text-decoration: none;
378
+
379
+ padding: 10px; !important;
380
+
381
+ border-bottom:1px solid #000;
382
+
383
+ color:#222; !important;
384
+
385
+ text-align: left;
386
+
387
+ line-height: 1.5em;
388
+
389
+ font-size: 14px;
390
+
391
+ }
140
392
 
141
393
  コード
142
394
 
@@ -145,443 +397,3 @@
145
397
  コード
146
398
 
147
399
  ```
148
-
149
-
150
-
151
-
152
-
153
- container {
154
-
155
- max-width: 375px;
156
-
157
- margin: 30px auto;
158
-
159
- border: 1px solid #CCC;
160
-
161
- }
162
-
163
- .swiper-container {
164
-
165
- margin: 0 auto 30px;
166
-
167
- }
168
-
169
- .tab-menu {
170
-
171
- border-bottom: 1px solid #CCC;
172
-
173
- }
174
-
175
- .tab-menu .swiper-slide {
176
-
177
- width: auto;
178
-
179
- padding: 10px 0;
180
-
181
- }
182
-
183
- .tab-contents {
184
-
185
- margin: 30px auto;
186
-
187
- }
188
-
189
- .swiper-slide-thumb-active {
190
-
191
- border-bottom: 2px solid rgb(9, 8, 53);
192
-
193
- color: rgb(9, 8, 53) !important;
194
-
195
- font-weight: bold;
196
-
197
- }
198
-
199
-
200
-
201
- ```
202
-
203
-
204
-
205
- よろしくお願いします。
206
-
207
-
208
-
209
-
210
-
211
- 今現地のものです。
212
-
213
-
214
-
215
- **html**
216
-
217
- ```<div class="container1">
218
-
219
- <nav id="global-nav">
220
-
221
- <div class="swiper-container swiper-navigation">
222
-
223
- <div class="swiper-wrapper">
224
-
225
- <div class="swiper-slide" data-type="article active" data-tag="ボックス1"></div>
226
-
227
- <div class="swiper-slide" data-type="article" data-tag="ボックス2"></div>
228
-
229
- <div class="swiper-slide" data-type="article" data-tag="ボックス3"></div>
230
-
231
- <div class="swiper-slide" data-type="article" data-tag="ボックス4"></div>
232
-
233
- <div class="swiper-slide" data-type="article" data-tag="ボックス5"></div>
234
-
235
- <div class="swiper-slide" data-type="article" data-tag="ボックス6"></div>
236
-
237
- <div class="swiper-slide" data-type="article" data-tag="ボックス7"></div>
238
-
239
- <div class="swiper-slide" data-type="article" data-tag="ボックス8"></div>
240
-
241
- </div>
242
-
243
- <div class="swiper-pagination"></div>
244
-
245
- </div>
246
-
247
- </div>
248
-
249
- <div class="swiper-container tab-contents">
250
-
251
- <div class="swiper-wrapper">
252
-
253
- <div class="swiper-slide">ボックス9</div>
254
-
255
-   <div class="swiper-slide">ボックス10</div>
256
-
257
- <div class="swiper-slide">ボックス11</div>
258
-
259
- <div class="swiper-slide">ボックス12</div>
260
-
261
- <div class="swiper-slide">ボックス13</div>
262
-
263
-    <div class="swiper-slide">ボックス14</div>
264
-
265
- <div class="swiper-slide">ボックス15</div>
266
-
267
- <div class="swiper-slide">ボックス16</div>
268
-
269
- </div>
270
-
271
- </div>
272
-
273
- ```**JavaScript**
274
-
275
-
276
-
277
- ``jQuery(function($){
278
-
279
- $(document).ready(function(){
280
-
281
-
282
-
283
-
284
-
285
- window.addEventListener('DOMContentLoaded', function() {
286
-
287
-
288
-
289
-
290
-
291
- // グローバルメニューの固定
292
-
293
-
294
-
295
- var navPos = jQuery( '#global-nav' ).offset().top; // グローバルメニューの位置
296
-
297
- var navHeight = jQuery( '#global-nav' ).outerHeight(); // グローバルメニューの高さ
298
-
299
- jQuery( window ).on( 'scroll', function() {
300
-
301
- if ( jQuery( this ).scrollTop() > navPos ) {
302
-
303
- jQuery( 'body' ).css( 'padding-top', navHeight );
304
-
305
- jQuery( '#global-nav' ).addClass( 'm_fixed' );
306
-
307
- } else {
308
-
309
- jQuery( 'body' ).css( 'padding-top', 0 );
310
-
311
- jQuery( '#global-nav' ).removeClass( 'm_fixed' );
312
-
313
- }
314
-
315
- });
316
-
317
-
318
-
319
- var galleryThumbs = new Swiper('.swiper-navigation', {
320
-
321
- spaceBetween: 2,
322
-
323
- slidesPerView: 5,
324
-
325
- watchSlidesVisibility: true,
326
-
327
- watchSlidesProgress: true,
328
-
329
- grabCursor: true,
330
-
331
- slideToClickedSlide: true,
332
-
333
- freeMode: true,
334
-
335
-  
336
-
337
- on: {
338
-
339
- tap: function(event) {
340
-
341
- // 選択されてないタブをタップしたら下のスライダーを動かす
342
-
343
- if (this.clickedIndex !== galleryThumbs.activeIndex &&
344
-
345
- $(this.clickedSlide).data('tag') !== $(galleryThumbs.slides[galleryThumbs.activeIndex]).data('tag')
346
-
347
- ) {
348
-
349
- galleryThumbs.slideTo(this.clickedIndex);
350
-
351
- }
352
-
353
- }
354
-
355
- }
356
-
357
- });
358
-
359
-
360
-
361
- var galleryTop = new Swiper('.tab-contents', {
362
-
363
- direction: 'horizontal',
364
-
365
- loop: false,
366
-
367
- slideToClickedSlide: true,
368
-
369
- thumbs: {swiper: galleryThumbs},
370
-
371
- });
372
-
373
-
374
-
375
- });
376
-
377
- });
378
-
379
- });
380
-
381
-
382
-
383
- ```**css**
384
-
385
-
386
-
387
- body{
388
-
389
-
390
-
391
- }
392
-
393
-
394
-
395
-
396
-
397
-
398
-
399
- .contener1{
400
-
401
- width: auto;
402
-
403
- margin-left:2%;
404
-
405
- }
406
-
407
-
408
-
409
-
410
-
411
- #global-nav {
412
-
413
- width: auto;
414
-
415
- height: 40px;
416
-
417
- margin-left:0%;
418
-
419
- background: #fff;
420
-
421
- width: 100%;
422
-
423
- z-index:999;
424
-
425
- }
426
-
427
-
428
-
429
- #global-nav.m_fixed {
430
-
431
- left: 0;
432
-
433
- position: fixed;
434
-
435
- top: 0;
436
-
437
- }
438
-
439
-
440
-
441
- .swiper-container {
442
-
443
- margin: 0 auto 30px;
444
-
445
- }
446
-
447
-
448
-
449
- /* 下線*/
450
-
451
- .swiper-navigation {
452
-
453
- width: auto;
454
-
455
- border-bottom:2px solid #e6e6e6;
456
-
457
-
458
-
459
- }
460
-
461
- .swiper-slide-thumb-active {
462
-
463
-  transform:translateX(-50%)
464
-
465
- opacity: .7;
466
-
467
- background-color: rgb(242, 56, 121) !important;
468
-
469
- border-bottom: 10px solid rgb(242, 56, 121) !important;
470
-
471
- color: rgb(250,250, 250) !important;
472
-
473
- font-weight: bold;
474
-
475
-
476
-
477
- }
478
-
479
-
480
-
481
-
482
-
483
- /* タブ*/
484
-
485
- .swiper-navigation .swiper-slide{
486
-
487
- /* widthに100%を4で割る指定*/
488
-
489
-  content:"";
490
-
491
- text-align: center;
492
-
493
- width: auto;
494
-
495
-
496
-
497
- height: 35px;
498
-
499
- line-height:40px;
500
-
501
- background-color: #a7f2e4;
502
-
503
- font-weight: bold;
504
-
505
- font-size: calc(70% + 0.12vw)
506
-
507
- }
508
-
509
-
510
-
511
- /* タブの色の濃さ さわらない*/
512
-
513
- .tab-menu .swiper-slide {
514
-
515
- cursor: pointer;
516
-
517
- opacity: .7;
518
-
519
- }
520
-
521
- ```ここに言語を入力
522
-
523
- コード
524
-
525
- ```
526
-
527
- .swiper-navigation .swiper-wrapper{
528
-
529
-
530
-
531
- /* タブからコンテンツの距離 */
532
-
533
- height:40px;
534
-
535
- }
536
-
537
-
538
-
539
-
540
-
541
- /* コンテンツ */
542
-
543
-
544
-
545
- .tab-contens{
546
-
547
- background-color: #dcdcdc;
548
-
549
- text-align: center;
550
-
551
- margin-left:2%;
552
-
553
- }
554
-
555
-
556
-
557
-
558
-
559
- .tab-contens div a{
560
-
561
- display: table;
562
-
563
- width: 100%;
564
-
565
- text-decoration: none;
566
-
567
- padding: 10px; !important;
568
-
569
- border-bottom:1px solid #000;
570
-
571
- color:#222; !important;
572
-
573
- text-align: left;
574
-
575
- line-height: 1.5em;
576
-
577
- font-size: 14px;
578
-
579
- }
580
-
581
- コード
582
-
583
- ```
584
-
585
- コード
586
-
587
- ```

4

2020/02/25 13:47

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,8 @@
1
+ ```ここに言語を入力
2
+
3
+ コード
4
+
1
- メニュータブを8個つくって
5
+ ```メニュータブを8個つくって
2
6
 
3
7
 
4
8
 
@@ -94,9 +98,7 @@
94
98
 
95
99
 
96
100
 
97
-
98
-
99
- <script>
101
+ ```<script>
100
102
 
101
103
  var galleryThumbs = new Swiper('.tab-menu', {
102
104
 
@@ -134,6 +136,16 @@
134
136
 
135
137
  </script>
136
138
 
139
+ ```ここに言語を入力
140
+
141
+ コード
142
+
143
+ ```
144
+
145
+ コード
146
+
147
+ ```
148
+
137
149
 
138
150
 
139
151
 
@@ -258,15 +270,11 @@
258
270
 
259
271
  </div>
260
272
 
261
-
262
-
263
-
264
-
265
- **JavaScript**
273
+ ```**JavaScript**
266
-
267
-
268
-
274
+
275
+
276
+
269
- ```jQuery(function($){
277
+ ``jQuery(function($){
270
278
 
271
279
  $(document).ready(function(){
272
280
 
@@ -372,7 +380,7 @@
372
380
 
373
381
 
374
382
 
375
- **css**
383
+ ```**css**
376
384
 
377
385
 
378
386
 
@@ -418,16 +426,6 @@
418
426
 
419
427
 
420
428
 
421
-
422
-
423
-
424
-
425
-
426
-
427
-
428
-
429
-
430
-
431
429
  #global-nav.m_fixed {
432
430
 
433
431
  left: 0;
@@ -440,18 +438,6 @@
440
438
 
441
439
 
442
440
 
443
-
444
-
445
-
446
-
447
-
448
-
449
-
450
-
451
-
452
-
453
-
454
-
455
441
  .swiper-container {
456
442
 
457
443
  margin: 0 auto 30px;
@@ -522,10 +508,6 @@
522
508
 
523
509
 
524
510
 
525
-
526
-
527
-
528
-
529
511
  /* タブの色の濃さ さわらない*/
530
512
 
531
513
  .tab-menu .swiper-slide {
@@ -595,3 +577,11 @@
595
577
  font-size: 14px;
596
578
 
597
579
  }
580
+
581
+ コード
582
+
583
+ ```
584
+
585
+ コード
586
+
587
+ ```

3

2020/02/25 13:43

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
@@ -96,464 +96,452 @@
96
96
 
97
97
 
98
98
 
99
+ <script>
100
+
101
+ var galleryThumbs = new Swiper('.tab-menu', {
102
+
103
+ spaceBetween: 20,
104
+
105
+ slidesPerView: 'auto',
106
+
107
+ watchSlidesVisibility: true,
108
+
109
+ watchSlidesProgress: true,
110
+
111
+ slideActiveClass: 'swiper-slide-active'
112
+
113
+ });
114
+
115
+ galleryThumbs.on('tap', function () {
116
+
117
+ var current = galleryTop.activeIndex;
118
+
119
+ galleryThumbs.slideTo(current, 500, true);
120
+
121
+ });
122
+
123
+ var galleryTop = new Swiper('.tab-contents', {
124
+
125
+ autoHeight: true,
126
+
127
+ thumbs: {
128
+
129
+ swiper: galleryThumbs
130
+
131
+ }
132
+
133
+ });
134
+
135
+ </script>
136
+
137
+
138
+
139
+
140
+
141
+ container {
142
+
143
+ max-width: 375px;
144
+
145
+ margin: 30px auto;
146
+
147
+ border: 1px solid #CCC;
148
+
149
+ }
150
+
151
+ .swiper-container {
152
+
153
+ margin: 0 auto 30px;
154
+
155
+ }
156
+
157
+ .tab-menu {
158
+
159
+ border-bottom: 1px solid #CCC;
160
+
161
+ }
162
+
163
+ .tab-menu .swiper-slide {
164
+
165
+ width: auto;
166
+
167
+ padding: 10px 0;
168
+
169
+ }
170
+
171
+ .tab-contents {
172
+
173
+ margin: 30px auto;
174
+
175
+ }
176
+
177
+ .swiper-slide-thumb-active {
178
+
179
+ border-bottom: 2px solid rgb(9, 8, 53);
180
+
181
+ color: rgb(9, 8, 53) !important;
182
+
183
+ font-weight: bold;
184
+
185
+ }
186
+
99
187
 
100
188
 
101
189
  ```
102
190
 
191
+
192
+
193
+ よろしくお願いします。
194
+
195
+
196
+
197
+
198
+
199
+ 今現地のものです。
200
+
201
+
202
+
203
+ **html**
204
+
205
+ ```<div class="container1">
206
+
207
+ <nav id="global-nav">
208
+
209
+ <div class="swiper-container swiper-navigation">
210
+
211
+ <div class="swiper-wrapper">
212
+
213
+ <div class="swiper-slide" data-type="article active" data-tag="ボックス1"></div>
214
+
215
+ <div class="swiper-slide" data-type="article" data-tag="ボックス2"></div>
216
+
217
+ <div class="swiper-slide" data-type="article" data-tag="ボックス3"></div>
218
+
219
+ <div class="swiper-slide" data-type="article" data-tag="ボックス4"></div>
220
+
221
+ <div class="swiper-slide" data-type="article" data-tag="ボックス5"></div>
222
+
223
+ <div class="swiper-slide" data-type="article" data-tag="ボックス6"></div>
224
+
225
+ <div class="swiper-slide" data-type="article" data-tag="ボックス7"></div>
226
+
227
+ <div class="swiper-slide" data-type="article" data-tag="ボックス8"></div>
228
+
103
- ```<script>
229
+ </div>
230
+
104
-
231
+ <div class="swiper-pagination"></div>
232
+
233
+ </div>
234
+
235
+ </div>
236
+
237
+ <div class="swiper-container tab-contents">
238
+
239
+ <div class="swiper-wrapper">
240
+
241
+ <div class="swiper-slide">ボックス9</div>
242
+
243
+   <div class="swiper-slide">ボックス10</div>
244
+
245
+ <div class="swiper-slide">ボックス11</div>
246
+
247
+ <div class="swiper-slide">ボックス12</div>
248
+
249
+ <div class="swiper-slide">ボックス13</div>
250
+
251
+    <div class="swiper-slide">ボックス14</div>
252
+
253
+ <div class="swiper-slide">ボックス15</div>
254
+
255
+ <div class="swiper-slide">ボックス16</div>
256
+
257
+ </div>
258
+
259
+ </div>
260
+
261
+
262
+
263
+
264
+
265
+ **JavaScript**
266
+
267
+
268
+
269
+ ```jQuery(function($){
270
+
271
+ $(document).ready(function(){
272
+
273
+
274
+
275
+
276
+
277
+ window.addEventListener('DOMContentLoaded', function() {
278
+
279
+
280
+
281
+
282
+
283
+ // グローバルメニューの固定
284
+
285
+
286
+
287
+ var navPos = jQuery( '#global-nav' ).offset().top; // グローバルメニューの位置
288
+
289
+ var navHeight = jQuery( '#global-nav' ).outerHeight(); // グローバルメニューの高さ
290
+
291
+ jQuery( window ).on( 'scroll', function() {
292
+
293
+ if ( jQuery( this ).scrollTop() > navPos ) {
294
+
295
+ jQuery( 'body' ).css( 'padding-top', navHeight );
296
+
297
+ jQuery( '#global-nav' ).addClass( 'm_fixed' );
298
+
299
+ } else {
300
+
301
+ jQuery( 'body' ).css( 'padding-top', 0 );
302
+
303
+ jQuery( '#global-nav' ).removeClass( 'm_fixed' );
304
+
305
+ }
306
+
307
+ });
308
+
309
+
310
+
105
- var galleryThumbs = new Swiper('.tab-menu', {
311
+ var galleryThumbs = new Swiper('.swiper-navigation', {
106
-
312
+
107
- spaceBetween: 20,
313
+ spaceBetween: 2,
108
-
314
+
109
- slidesPerView: 'auto',
315
+ slidesPerView: 5,
110
316
 
111
317
  watchSlidesVisibility: true,
112
318
 
113
319
  watchSlidesProgress: true,
114
320
 
321
+ grabCursor: true,
322
+
115
- slideActiveClass: 'swiper-slide-active'
323
+ slideToClickedSlide: true,
324
+
116
-
325
+ freeMode: true,
326
+
327
+  
328
+
117
- });
329
+ on: {
118
-
330
+
119
- galleryThumbs.on('tap', function () {
331
+ tap: function(event) {
332
+
120
-
333
+ // 選択されてないタブをタップしたら下のスライダーを動かす
334
+
121
- var current = galleryTop.activeIndex;
335
+ if (this.clickedIndex !== galleryThumbs.activeIndex &&
336
+
122
-
337
+ $(this.clickedSlide).data('tag') !== $(galleryThumbs.slides[galleryThumbs.activeIndex]).data('tag')
338
+
339
+ ) {
340
+
123
- galleryThumbs.slideTo(current, 500, true);
341
+ galleryThumbs.slideTo(this.clickedIndex);
124
-
342
+
125
- });
343
+ }
126
-
127
- var galleryTop = new Swiper('.tab-contents', {
344
+
128
-
129
- autoHeight: true,
130
-
131
- thumbs: {
345
+ }
132
-
133
- swiper: galleryThumbs
134
346
 
135
347
  }
136
348
 
137
349
  });
138
350
 
351
+
352
+
353
+ var galleryTop = new Swiper('.tab-contents', {
354
+
355
+ direction: 'horizontal',
356
+
357
+ loop: false,
358
+
359
+ slideToClickedSlide: true,
360
+
361
+ thumbs: {swiper: galleryThumbs},
362
+
363
+ });
364
+
365
+
366
+
367
+ });
368
+
369
+ });
370
+
371
+ });
372
+
373
+
374
+
375
+ **css**
376
+
377
+
378
+
379
+ body{
380
+
381
+
382
+
383
+ }
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+ .contener1{
392
+
393
+ width: auto;
394
+
395
+ margin-left:2%;
396
+
397
+ }
398
+
399
+
400
+
401
+
402
+
403
+ #global-nav {
404
+
405
+ width: auto;
406
+
407
+ height: 40px;
408
+
409
+ margin-left:0%;
410
+
411
+ background: #fff;
412
+
413
+ width: 100%;
414
+
415
+ z-index:999;
416
+
417
+ }
418
+
419
+
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+
431
+ #global-nav.m_fixed {
432
+
433
+ left: 0;
434
+
435
+ position: fixed;
436
+
437
+ top: 0;
438
+
439
+ }
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+ .swiper-container {
456
+
457
+ margin: 0 auto 30px;
458
+
459
+ }
460
+
461
+
462
+
139
- </script>
463
+ /* 下線*/
464
+
465
+ .swiper-navigation {
466
+
467
+ width: auto;
468
+
469
+ border-bottom:2px solid #e6e6e6;
470
+
471
+
472
+
473
+ }
474
+
475
+ .swiper-slide-thumb-active {
476
+
477
+  transform:translateX(-50%)
478
+
479
+ opacity: .7;
480
+
481
+ background-color: rgb(242, 56, 121) !important;
482
+
483
+ border-bottom: 10px solid rgb(242, 56, 121) !important;
484
+
485
+ color: rgb(250,250, 250) !important;
486
+
487
+ font-weight: bold;
488
+
489
+
490
+
491
+ }
492
+
493
+
494
+
495
+
496
+
497
+ /* タブ*/
498
+
499
+ .swiper-navigation .swiper-slide{
500
+
501
+ /* widthに100%を4で割る指定*/
502
+
503
+  content:"";
504
+
505
+ text-align: center;
506
+
507
+ width: auto;
508
+
509
+
510
+
511
+ height: 35px;
512
+
513
+ line-height:40px;
514
+
515
+ background-color: #a7f2e4;
516
+
517
+ font-weight: bold;
518
+
519
+ font-size: calc(70% + 0.12vw)
520
+
521
+ }
522
+
523
+
524
+
525
+
526
+
527
+
528
+
529
+ /* タブの色の濃さ さわらない*/
530
+
531
+ .tab-menu .swiper-slide {
532
+
533
+ cursor: pointer;
534
+
535
+ opacity: .7;
536
+
537
+ }
538
+
539
+ ```ここに言語を入力
540
+
541
+ コード
140
542
 
141
543
  ```
142
544
 
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
- ```.container {
154
-
155
- max-width: 375px;
156
-
157
- margin: 30px auto;
158
-
159
- border: 1px solid #CCC;
160
-
161
- }
162
-
163
- .swiper-container {
164
-
165
- margin: 0 auto 30px;
166
-
167
- }
168
-
169
- .tab-menu {
170
-
171
- border-bottom: 1px solid #CCC;
172
-
173
- }
174
-
175
- .tab-menu .swiper-slide {
176
-
177
- width: auto;
178
-
179
- padding: 10px 0;
180
-
181
- }
182
-
183
- .tab-contents {
184
-
185
- margin: 30px auto;
186
-
187
- }
188
-
189
- .swiper-slide-thumb-active {
190
-
191
- border-bottom: 2px solid rgb(9, 8, 53);
192
-
193
- color: rgb(9, 8, 53) !important;
194
-
195
- font-weight: bold;
196
-
197
- }
198
-
199
-
200
-
201
- ```
202
-
203
-
204
-
205
- よろしくお願いします。
206
-
207
-
208
-
209
-
210
-
211
- 今現地のものです。
212
-
213
-
214
-
215
- **html**
216
-
217
- ```<div class="container1">
218
-
219
- <nav id="global-nav">
220
-
221
- <div class="swiper-container swiper-navigation">
222
-
223
- <div class="swiper-wrapper">
224
-
225
- <div class="swiper-slide" data-type="article active" data-tag="ボックス1"></div>
226
-
227
- <div class="swiper-slide" data-type="article" data-tag="ボックス2"></div>
228
-
229
- <div class="swiper-slide" data-type="article" data-tag="ボックス3"></div>
230
-
231
- <div class="swiper-slide" data-type="article" data-tag="ボックス4"></div>
232
-
233
- <div class="swiper-slide" data-type="article" data-tag="ボックス5"></div>
234
-
235
- <div class="swiper-slide" data-type="article" data-tag="ボックス6"></div>
236
-
237
- <div class="swiper-slide" data-type="article" data-tag="ボックス7"></div>
238
-
239
- <div class="swiper-slide" data-type="article" data-tag="ボックス8"></div>
240
-
241
- </div>
242
-
243
- <div class="swiper-pagination"></div>
244
-
245
- </div>
246
-
247
- </div>
248
-
249
- <div class="swiper-container tab-contents">
250
-
251
- <div class="swiper-wrapper">
252
-
253
- <div class="swiper-slide">ボックス9</div>
254
-
255
-   <div class="swiper-slide">ボックス10</div>
256
-
257
- <div class="swiper-slide">ボックス11</div>
258
-
259
- <div class="swiper-slide">ボックス12</div>
260
-
261
- <div class="swiper-slide">ボックス13</div>
262
-
263
-    <div class="swiper-slide">ボックス14</div>
264
-
265
- <div class="swiper-slide">ボックス15</div>
266
-
267
- <div class="swiper-slide">ボックス16</div>
268
-
269
- </div>
270
-
271
- </div>
272
-
273
-
274
-
275
-
276
-
277
- **JavaScript**
278
-
279
-
280
-
281
- ```jQuery(function($){
282
-
283
- $(document).ready(function(){
284
-
285
-
286
-
287
-
288
-
289
- window.addEventListener('DOMContentLoaded', function() {
290
-
291
-
292
-
293
-
294
-
295
- // グローバルメニューの固定
296
-
297
-
298
-
299
- var navPos = jQuery( '#global-nav' ).offset().top; // グローバルメニューの位置
300
-
301
- var navHeight = jQuery( '#global-nav' ).outerHeight(); // グローバルメニューの高さ
302
-
303
- jQuery( window ).on( 'scroll', function() {
304
-
305
- if ( jQuery( this ).scrollTop() > navPos ) {
306
-
307
- jQuery( 'body' ).css( 'padding-top', navHeight );
308
-
309
- jQuery( '#global-nav' ).addClass( 'm_fixed' );
310
-
311
- } else {
312
-
313
- jQuery( 'body' ).css( 'padding-top', 0 );
314
-
315
- jQuery( '#global-nav' ).removeClass( 'm_fixed' );
316
-
317
- }
318
-
319
- });
320
-
321
-
322
-
323
- var galleryThumbs = new Swiper('.swiper-navigation', {
324
-
325
- spaceBetween: 2,
326
-
327
- slidesPerView: 5,
328
-
329
- watchSlidesVisibility: true,
330
-
331
- watchSlidesProgress: true,
332
-
333
- grabCursor: true,
334
-
335
- slideToClickedSlide: true,
336
-
337
- freeMode: true,
338
-
339
-  
340
-
341
- on: {
342
-
343
- tap: function(event) {
344
-
345
- // 選択されてないタブをタップしたら下のスライダーを動かす
346
-
347
- if (this.clickedIndex !== galleryThumbs.activeIndex &&
348
-
349
- $(this.clickedSlide).data('tag') !== $(galleryThumbs.slides[galleryThumbs.activeIndex]).data('tag')
350
-
351
- ) {
352
-
353
- galleryThumbs.slideTo(this.clickedIndex);
354
-
355
- }
356
-
357
- }
358
-
359
- }
360
-
361
- });
362
-
363
-
364
-
365
- var galleryTop = new Swiper('.tab-contents', {
366
-
367
- direction: 'horizontal',
368
-
369
- loop: false,
370
-
371
- slideToClickedSlide: true,
372
-
373
- thumbs: {swiper: galleryThumbs},
374
-
375
- });
376
-
377
-
378
-
379
- });
380
-
381
- });
382
-
383
- });
384
-
385
-
386
-
387
- **css**
388
-
389
-
390
-
391
- body{
392
-
393
-
394
-
395
- }
396
-
397
-
398
-
399
-
400
-
401
-
402
-
403
- .contener1{
404
-
405
- width: auto;
406
-
407
- margin-left:2%;
408
-
409
- }
410
-
411
-
412
-
413
-
414
-
415
- #global-nav {
416
-
417
- width: auto;
418
-
419
- height: 40px;
420
-
421
- margin-left:0%;
422
-
423
- background: #fff;
424
-
425
- width: 100%;
426
-
427
- z-index:999;
428
-
429
- }
430
-
431
-
432
-
433
-
434
-
435
-
436
-
437
-
438
-
439
-
440
-
441
-
442
-
443
- #global-nav.m_fixed {
444
-
445
- left: 0;
446
-
447
- position: fixed;
448
-
449
- top: 0;
450
-
451
- }
452
-
453
-
454
-
455
-
456
-
457
-
458
-
459
-
460
-
461
-
462
-
463
-
464
-
465
-
466
-
467
- .swiper-container {
468
-
469
- margin: 0 auto 30px;
470
-
471
- }
472
-
473
-
474
-
475
- /* 下線*/
476
-
477
- .swiper-navigation {
478
-
479
- width: auto;
480
-
481
- border-bottom:2px solid #e6e6e6;
482
-
483
-
484
-
485
- }
486
-
487
- .swiper-slide-thumb-active {
488
-
489
-  transform:translateX(-50%)
490
-
491
- opacity: .7;
492
-
493
- background-color: rgb(242, 56, 121) !important;
494
-
495
- border-bottom: 10px solid rgb(242, 56, 121) !important;
496
-
497
- color: rgb(250,250, 250) !important;
498
-
499
- font-weight: bold;
500
-
501
-
502
-
503
- }
504
-
505
-
506
-
507
-
508
-
509
- /* タブ*/
510
-
511
- .swiper-navigation .swiper-slide{
512
-
513
- /* widthに100%を4で割る指定*/
514
-
515
-  content:"";
516
-
517
- text-align: center;
518
-
519
- width: auto;
520
-
521
-
522
-
523
- height: 35px;
524
-
525
- line-height:40px;
526
-
527
- background-color: #a7f2e4;
528
-
529
- font-weight: bold;
530
-
531
- font-size: calc(70% + 0.12vw)
532
-
533
- }
534
-
535
-
536
-
537
-
538
-
539
-
540
-
541
- /* タブの色の濃さ さわらない*/
542
-
543
- .tab-menu .swiper-slide {
544
-
545
- cursor: pointer;
546
-
547
- opacity: .7;
548
-
549
- }
550
-
551
- ```ここに言語を入力
552
-
553
- コード
554
-
555
- ```
556
-
557
545
  .swiper-navigation .swiper-wrapper{
558
546
 
559
547
 

2

2020/02/25 13:38

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
@@ -203,3 +203,407 @@
203
203
 
204
204
 
205
205
  よろしくお願いします。
206
+
207
+
208
+
209
+
210
+
211
+ 今現地のものです。
212
+
213
+
214
+
215
+ **html**
216
+
217
+ ```<div class="container1">
218
+
219
+ <nav id="global-nav">
220
+
221
+ <div class="swiper-container swiper-navigation">
222
+
223
+ <div class="swiper-wrapper">
224
+
225
+ <div class="swiper-slide" data-type="article active" data-tag="ボックス1"></div>
226
+
227
+ <div class="swiper-slide" data-type="article" data-tag="ボックス2"></div>
228
+
229
+ <div class="swiper-slide" data-type="article" data-tag="ボックス3"></div>
230
+
231
+ <div class="swiper-slide" data-type="article" data-tag="ボックス4"></div>
232
+
233
+ <div class="swiper-slide" data-type="article" data-tag="ボックス5"></div>
234
+
235
+ <div class="swiper-slide" data-type="article" data-tag="ボックス6"></div>
236
+
237
+ <div class="swiper-slide" data-type="article" data-tag="ボックス7"></div>
238
+
239
+ <div class="swiper-slide" data-type="article" data-tag="ボックス8"></div>
240
+
241
+ </div>
242
+
243
+ <div class="swiper-pagination"></div>
244
+
245
+ </div>
246
+
247
+ </div>
248
+
249
+ <div class="swiper-container tab-contents">
250
+
251
+ <div class="swiper-wrapper">
252
+
253
+ <div class="swiper-slide">ボックス9</div>
254
+
255
+   <div class="swiper-slide">ボックス10</div>
256
+
257
+ <div class="swiper-slide">ボックス11</div>
258
+
259
+ <div class="swiper-slide">ボックス12</div>
260
+
261
+ <div class="swiper-slide">ボックス13</div>
262
+
263
+    <div class="swiper-slide">ボックス14</div>
264
+
265
+ <div class="swiper-slide">ボックス15</div>
266
+
267
+ <div class="swiper-slide">ボックス16</div>
268
+
269
+ </div>
270
+
271
+ </div>
272
+
273
+
274
+
275
+
276
+
277
+ **JavaScript**
278
+
279
+
280
+
281
+ ```jQuery(function($){
282
+
283
+ $(document).ready(function(){
284
+
285
+
286
+
287
+
288
+
289
+ window.addEventListener('DOMContentLoaded', function() {
290
+
291
+
292
+
293
+
294
+
295
+ // グローバルメニューの固定
296
+
297
+
298
+
299
+ var navPos = jQuery( '#global-nav' ).offset().top; // グローバルメニューの位置
300
+
301
+ var navHeight = jQuery( '#global-nav' ).outerHeight(); // グローバルメニューの高さ
302
+
303
+ jQuery( window ).on( 'scroll', function() {
304
+
305
+ if ( jQuery( this ).scrollTop() > navPos ) {
306
+
307
+ jQuery( 'body' ).css( 'padding-top', navHeight );
308
+
309
+ jQuery( '#global-nav' ).addClass( 'm_fixed' );
310
+
311
+ } else {
312
+
313
+ jQuery( 'body' ).css( 'padding-top', 0 );
314
+
315
+ jQuery( '#global-nav' ).removeClass( 'm_fixed' );
316
+
317
+ }
318
+
319
+ });
320
+
321
+
322
+
323
+ var galleryThumbs = new Swiper('.swiper-navigation', {
324
+
325
+ spaceBetween: 2,
326
+
327
+ slidesPerView: 5,
328
+
329
+ watchSlidesVisibility: true,
330
+
331
+ watchSlidesProgress: true,
332
+
333
+ grabCursor: true,
334
+
335
+ slideToClickedSlide: true,
336
+
337
+ freeMode: true,
338
+
339
+  
340
+
341
+ on: {
342
+
343
+ tap: function(event) {
344
+
345
+ // 選択されてないタブをタップしたら下のスライダーを動かす
346
+
347
+ if (this.clickedIndex !== galleryThumbs.activeIndex &&
348
+
349
+ $(this.clickedSlide).data('tag') !== $(galleryThumbs.slides[galleryThumbs.activeIndex]).data('tag')
350
+
351
+ ) {
352
+
353
+ galleryThumbs.slideTo(this.clickedIndex);
354
+
355
+ }
356
+
357
+ }
358
+
359
+ }
360
+
361
+ });
362
+
363
+
364
+
365
+ var galleryTop = new Swiper('.tab-contents', {
366
+
367
+ direction: 'horizontal',
368
+
369
+ loop: false,
370
+
371
+ slideToClickedSlide: true,
372
+
373
+ thumbs: {swiper: galleryThumbs},
374
+
375
+ });
376
+
377
+
378
+
379
+ });
380
+
381
+ });
382
+
383
+ });
384
+
385
+
386
+
387
+ **css**
388
+
389
+
390
+
391
+ body{
392
+
393
+
394
+
395
+ }
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+ .contener1{
404
+
405
+ width: auto;
406
+
407
+ margin-left:2%;
408
+
409
+ }
410
+
411
+
412
+
413
+
414
+
415
+ #global-nav {
416
+
417
+ width: auto;
418
+
419
+ height: 40px;
420
+
421
+ margin-left:0%;
422
+
423
+ background: #fff;
424
+
425
+ width: 100%;
426
+
427
+ z-index:999;
428
+
429
+ }
430
+
431
+
432
+
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+ #global-nav.m_fixed {
444
+
445
+ left: 0;
446
+
447
+ position: fixed;
448
+
449
+ top: 0;
450
+
451
+ }
452
+
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+ .swiper-container {
468
+
469
+ margin: 0 auto 30px;
470
+
471
+ }
472
+
473
+
474
+
475
+ /* 下線*/
476
+
477
+ .swiper-navigation {
478
+
479
+ width: auto;
480
+
481
+ border-bottom:2px solid #e6e6e6;
482
+
483
+
484
+
485
+ }
486
+
487
+ .swiper-slide-thumb-active {
488
+
489
+  transform:translateX(-50%)
490
+
491
+ opacity: .7;
492
+
493
+ background-color: rgb(242, 56, 121) !important;
494
+
495
+ border-bottom: 10px solid rgb(242, 56, 121) !important;
496
+
497
+ color: rgb(250,250, 250) !important;
498
+
499
+ font-weight: bold;
500
+
501
+
502
+
503
+ }
504
+
505
+
506
+
507
+
508
+
509
+ /* タブ*/
510
+
511
+ .swiper-navigation .swiper-slide{
512
+
513
+ /* widthに100%を4で割る指定*/
514
+
515
+  content:"";
516
+
517
+ text-align: center;
518
+
519
+ width: auto;
520
+
521
+
522
+
523
+ height: 35px;
524
+
525
+ line-height:40px;
526
+
527
+ background-color: #a7f2e4;
528
+
529
+ font-weight: bold;
530
+
531
+ font-size: calc(70% + 0.12vw)
532
+
533
+ }
534
+
535
+
536
+
537
+
538
+
539
+
540
+
541
+ /* タブの色の濃さ さわらない*/
542
+
543
+ .tab-menu .swiper-slide {
544
+
545
+ cursor: pointer;
546
+
547
+ opacity: .7;
548
+
549
+ }
550
+
551
+ ```ここに言語を入力
552
+
553
+ コード
554
+
555
+ ```
556
+
557
+ .swiper-navigation .swiper-wrapper{
558
+
559
+
560
+
561
+ /* タブからコンテンツの距離 */
562
+
563
+ height:40px;
564
+
565
+ }
566
+
567
+
568
+
569
+
570
+
571
+ /* コンテンツ */
572
+
573
+
574
+
575
+ .tab-contens{
576
+
577
+ background-color: #dcdcdc;
578
+
579
+ text-align: center;
580
+
581
+ margin-left:2%;
582
+
583
+ }
584
+
585
+
586
+
587
+
588
+
589
+ .tab-contens div a{
590
+
591
+ display: table;
592
+
593
+ width: 100%;
594
+
595
+ text-decoration: none;
596
+
597
+ padding: 10px; !important;
598
+
599
+ border-bottom:1px solid #000;
600
+
601
+ color:#222; !important;
602
+
603
+ text-align: left;
604
+
605
+ line-height: 1.5em;
606
+
607
+ font-size: 14px;
608
+
609
+ }

1

2020/02/25 13:36

投稿

kenshin
kenshin

スコア7

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,4 @@
1
- **__ボールドテキスト__**メニュータブを8個つくって
1
+ メニュータブを8個つくって
2
2
 
3
3
 
4
4