質問編集履歴
2
cssとjsのコードを質問文に追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,77 +4,55 @@
|
|
4
4
|
|
5
5
|
全て表示できない場合でもスクロールバーが表示されません。
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
3つ目、4つ目の商品名などの情報
|
7
|
+
3つ目、4つ目の商品名などの情報が表示されない原因はどこにあるのでしょうか。
|
10
|
-
|
11
|
-
※cssとjsは字数制限のため載せられませんでした。
|
12
|
-
|
13
|
-
|
14
8
|
|
15
9
|
```html
|
16
10
|
|
17
|
-
|
18
|
-
|
19
11
|
<!DOCTYPE html>
|
20
12
|
|
21
13
|
<html lang="ja">
|
22
14
|
|
23
|
-
|
24
|
-
|
25
15
|
<head>
|
26
16
|
|
27
17
|
<meta charset="utf-8">
|
28
18
|
|
29
|
-
<title>
|
19
|
+
<title></title>
|
30
|
-
|
31
|
-
<meta name="description" content="ディスクリプションを入力">
|
32
20
|
|
33
21
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
34
22
|
|
35
23
|
<link rel="stylesheet" href="css/style.css">
|
36
24
|
|
37
|
-
<!-- [if lt IE 9] -->
|
38
|
-
|
39
25
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
40
26
|
|
41
|
-
|
42
|
-
|
43
|
-
<!-- [endif] -->
|
44
|
-
|
45
27
|
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
|
46
28
|
|
47
29
|
<script src="js/app.js"></script>
|
48
30
|
|
49
31
|
</head>
|
50
32
|
|
51
|
-
|
52
|
-
|
53
33
|
<body>
|
54
34
|
|
55
|
-
<!----- header----->
|
56
|
-
|
57
35
|
<header>
|
58
36
|
|
59
37
|
<div class="logo">
|
60
38
|
|
61
|
-
<a href="
|
39
|
+
<a href=""></a>
|
62
40
|
|
63
41
|
</div>
|
64
42
|
|
65
43
|
<h1>
|
66
44
|
|
67
|
-
|
45
|
+
</h1>
|
68
46
|
|
69
47
|
<div class="modal-back"></div>
|
70
48
|
|
71
49
|
<div class="cart-modal">
|
72
50
|
|
73
|
-
<h2 class="post_title">
|
51
|
+
<h2 class="post_title"></h2>
|
74
52
|
|
75
53
|
</div>
|
76
54
|
|
77
|
-
<div class="cart-box"><a class="cart-check" href="
|
55
|
+
<div class="cart-box"><a class="cart-check" href="">(<span id="cart-count">0</span>)</a></div>
|
78
56
|
|
79
57
|
<script>
|
80
58
|
|
@@ -84,64 +62,10 @@
|
|
84
62
|
|
85
63
|
</script>
|
86
64
|
|
87
|
-
|
65
|
+
|
88
|
-
|
89
|
-
<li><a href="top.php">HOME</a></li>
|
90
|
-
|
91
|
-
<li>日本酒 <ul class="drop_menu">
|
92
|
-
|
93
|
-
<li><a href="product.php?id=5">純米酒</a></li>
|
94
|
-
|
95
|
-
<li><a href="product.php?id=6">果実酒</a></li>
|
96
|
-
|
97
|
-
<li><a href="product.php?id=7">日本酒ギフト</a></li>
|
98
|
-
|
99
|
-
</ul>
|
100
|
-
|
101
|
-
</li>
|
102
|
-
|
103
|
-
<li>ビール <ul class="drop_menu">
|
104
|
-
|
105
|
-
<li><a href="product.php?id=9">瓶ビール</a></li>
|
106
|
-
|
107
|
-
<li><a href="product.php?id=10">缶ビール</a></li>
|
108
|
-
|
109
|
-
<li><a href="product.php?id=11">ビールギフト</a></li>
|
110
|
-
|
111
|
-
</ul>
|
112
|
-
|
113
|
-
</li>
|
114
|
-
|
115
|
-
<li>おつまみ <ul class="drop_menu">
|
116
|
-
|
117
|
-
<li><a href="product.php?id=12">エイヒレ</a></li>
|
118
|
-
|
119
|
-
<li><a href="product.php?id=13">ウインナー</a></li>
|
120
|
-
|
121
|
-
<li><a href="product.php?id=14">奈良漬け</a></li>
|
122
|
-
|
123
|
-
</ul>
|
124
|
-
|
125
|
-
</li>
|
126
|
-
|
127
|
-
<li>コーヒー <ul class="drop_menu">
|
128
|
-
|
129
|
-
<li><a href="product.php?id=15">ボトルコーヒー</a></li>
|
130
|
-
|
131
|
-
<li><a href="product.php?id=16">コーヒーギフト</a></li>
|
132
|
-
|
133
|
-
</ul>
|
134
|
-
|
135
|
-
</li>
|
136
|
-
|
137
|
-
</ul>
|
138
66
|
|
139
67
|
</header>
|
140
68
|
|
141
|
-
<!----- /header ----->
|
142
|
-
|
143
|
-
<!----- main ----->
|
144
|
-
|
145
69
|
<div class="main">
|
146
70
|
|
147
71
|
<div class="product-corner">
|
@@ -158,19 +82,19 @@
|
|
158
82
|
|
159
83
|
<div class="product-item">
|
160
84
|
|
161
|
-
<img src="
|
85
|
+
<img src="" alt="" class="product-img">
|
162
86
|
|
163
87
|
<span class="product-name">
|
164
88
|
|
165
|
-
|
89
|
+
</span>
|
166
90
|
|
167
91
|
<span class="product-price">
|
168
92
|
|
169
|
-
|
93
|
+
</span>
|
170
94
|
|
171
95
|
<div class="info-box">
|
172
96
|
|
173
|
-
<div id="2" class="fav_button"><span class="fav_icon"></span><span class="__text">
|
97
|
+
<div id="2" class="fav_button"><span class="fav_icon"></span><span class="__text"><p id="sumi_2"></p></span>
|
174
98
|
|
175
99
|
</div>
|
176
100
|
|
@@ -178,28 +102,16 @@
|
|
178
102
|
|
179
103
|
checked_inspect(product_id);
|
180
104
|
|
181
|
-
|
182
|
-
|
183
105
|
</script>
|
184
106
|
|
185
107
|
<select id="cnt_2">
|
186
108
|
|
187
109
|
<option value="1">1</option>
|
188
110
|
|
189
|
-
<option value="2">2</option>
|
190
|
-
|
191
|
-
<option value="3">3</option>
|
192
|
-
|
193
|
-
<option value="4">4</option>
|
194
|
-
|
195
|
-
<option value="5">5</option>
|
196
|
-
|
197
111
|
</select>
|
198
112
|
|
199
113
|
<button class="cart_in" value="2">
|
200
114
|
|
201
|
-
カートに入れる
|
202
|
-
|
203
115
|
</button>
|
204
116
|
|
205
117
|
</div>
|
@@ -216,19 +128,19 @@
|
|
216
128
|
|
217
129
|
<div class="product-item">
|
218
130
|
|
219
|
-
<img src="
|
131
|
+
<img src="" alt="" class="product-img">
|
220
132
|
|
221
133
|
<span class="product-name">
|
222
134
|
|
223
|
-
|
135
|
+
</span>
|
224
136
|
|
225
137
|
<span class="product-price">
|
226
138
|
|
227
|
-
|
139
|
+
</span>
|
228
140
|
|
229
141
|
<div class="info-box">
|
230
142
|
|
231
|
-
<div id="4" class="fav_button"><span class="fav_icon"></span><span class="__text">
|
143
|
+
<div id="4" class="fav_button"><span class="fav_icon"></span><span class="__text"><p id="sumi_4"></p></span>
|
232
144
|
|
233
145
|
</div>
|
234
146
|
|
@@ -236,28 +148,16 @@
|
|
236
148
|
|
237
149
|
checked_inspect(product_id);
|
238
150
|
|
239
|
-
|
240
|
-
|
241
151
|
</script>
|
242
152
|
|
243
153
|
<select id="cnt_4">
|
244
154
|
|
245
155
|
<option value="1">1</option>
|
246
156
|
|
247
|
-
<option value="2">2</option>
|
248
|
-
|
249
|
-
<option value="3">3</option>
|
250
|
-
|
251
|
-
<option value="4">4</option>
|
252
|
-
|
253
|
-
<option value="5">5</option>
|
254
|
-
|
255
157
|
</select>
|
256
158
|
|
257
159
|
<button class="cart_in" value="4">
|
258
160
|
|
259
|
-
カートに入れる
|
260
|
-
|
261
161
|
</button>
|
262
162
|
|
263
163
|
</div>
|
@@ -268,25 +168,23 @@
|
|
268
168
|
|
269
169
|
var product_id = 6;
|
270
170
|
|
271
|
-
|
272
|
-
|
273
171
|
</script>
|
274
172
|
|
275
173
|
<div class="product-item">
|
276
174
|
|
277
|
-
<img src="
|
175
|
+
<img src="" alt="" class="product-img">
|
278
176
|
|
279
177
|
<span class="product-name">
|
280
178
|
|
281
|
-
|
179
|
+
</span>
|
282
180
|
|
283
181
|
<span class="product-price">
|
284
182
|
|
285
|
-
|
183
|
+
</span>
|
286
184
|
|
287
185
|
<div class="info-box">
|
288
186
|
|
289
|
-
<div id="6" class="fav_button"><span class="fav_icon"></span><span class="__text">
|
187
|
+
<div id="6" class="fav_button"><span class="fav_icon"></span><span class="__text"><p id="sumi_6"></p></span>
|
290
188
|
|
291
189
|
</div>
|
292
190
|
|
@@ -294,28 +192,16 @@
|
|
294
192
|
|
295
193
|
checked_inspect(product_id);
|
296
194
|
|
297
|
-
|
298
|
-
|
299
195
|
</script>
|
300
196
|
|
301
197
|
<select id="cnt_6">
|
302
198
|
|
303
199
|
<option value="1">1</option>
|
304
200
|
|
305
|
-
<option value="2">2</option>
|
306
|
-
|
307
|
-
<option value="3">3</option>
|
308
|
-
|
309
|
-
<option value="4">4</option>
|
310
|
-
|
311
|
-
<option value="5">5</option>
|
312
|
-
|
313
201
|
</select>
|
314
202
|
|
315
203
|
<button class="cart_in" value="6">
|
316
204
|
|
317
|
-
カートに入れる
|
318
|
-
|
319
205
|
</button>
|
320
206
|
|
321
207
|
</div>
|
@@ -326,27 +212,25 @@
|
|
326
212
|
|
327
213
|
var product_id = 7;
|
328
214
|
|
329
|
-
|
330
|
-
|
331
215
|
</script>
|
332
216
|
|
333
217
|
<div class="product-box">
|
334
218
|
|
335
219
|
<div class="product-item">
|
336
220
|
|
337
|
-
<img src="
|
221
|
+
<img src="" alt="" class="product-img">
|
338
222
|
|
339
223
|
<span class="product-name">
|
340
224
|
|
341
|
-
|
225
|
+
</span>
|
342
226
|
|
343
227
|
<span class="product-price">
|
344
228
|
|
345
|
-
|
229
|
+
</span>
|
346
230
|
|
347
231
|
<div class="info-box">
|
348
232
|
|
349
|
-
<div id="7" class="fav_button"><span class="fav_icon"></span><span class="__text">
|
233
|
+
<div id="7" class="fav_button"><span class="fav_icon"></span><span class="__text"><p id="sumi_7"></p></span>
|
350
234
|
|
351
235
|
</div>
|
352
236
|
|
@@ -354,28 +238,16 @@
|
|
354
238
|
|
355
239
|
checked_inspect(product_id);
|
356
240
|
|
357
|
-
|
358
|
-
|
359
241
|
</script>
|
360
242
|
|
361
243
|
<select id="cnt_7">
|
362
244
|
|
363
245
|
<option value="1">1</option>
|
364
246
|
|
365
|
-
<option value="2">2</option>
|
366
|
-
|
367
|
-
<option value="3">3</option>
|
368
|
-
|
369
|
-
<option value="4">4</option>
|
370
|
-
|
371
|
-
<option value="5">5</option>
|
372
|
-
|
373
247
|
</select>
|
374
248
|
|
375
249
|
<button class="cart_in" value="7">
|
376
250
|
|
377
|
-
カートに入れる
|
378
|
-
|
379
251
|
</button>
|
380
252
|
|
381
253
|
</div>
|
@@ -388,22 +260,576 @@
|
|
388
260
|
|
389
261
|
</div>
|
390
262
|
|
391
|
-
<!----- /main ----->
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
<!----- footer ----->
|
396
|
-
|
397
|
-
<footer>
|
263
|
+
<footer></footer>
|
398
|
-
|
399
|
-
<!----- /footer ----->
|
400
264
|
|
401
265
|
</body>
|
402
266
|
|
403
|
-
|
404
|
-
|
405
267
|
</html>
|
406
268
|
|
407
269
|
|
408
270
|
|
409
271
|
```
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
```css
|
276
|
+
|
277
|
+
* {
|
278
|
+
|
279
|
+
margin: 0;
|
280
|
+
|
281
|
+
padding: 0;
|
282
|
+
|
283
|
+
box-sizing: border-box;
|
284
|
+
|
285
|
+
list-style: none;
|
286
|
+
|
287
|
+
}
|
288
|
+
|
289
|
+
header{
|
290
|
+
|
291
|
+
height: 25px;
|
292
|
+
|
293
|
+
padding-bottom: 200px;
|
294
|
+
|
295
|
+
}
|
296
|
+
|
297
|
+
.logo{
|
298
|
+
|
299
|
+
position: relative;
|
300
|
+
|
301
|
+
top: 50px;
|
302
|
+
|
303
|
+
left: 70px;
|
304
|
+
|
305
|
+
}
|
306
|
+
|
307
|
+
.logo a{
|
308
|
+
|
309
|
+
position: relative;
|
310
|
+
|
311
|
+
text-decoration: none;
|
312
|
+
|
313
|
+
}
|
314
|
+
|
315
|
+
.cart-box{
|
316
|
+
|
317
|
+
position: relative;
|
318
|
+
|
319
|
+
float: right;
|
320
|
+
|
321
|
+
top:-50px;
|
322
|
+
|
323
|
+
right: 70px;
|
324
|
+
|
325
|
+
}
|
326
|
+
|
327
|
+
.cart-modal{
|
328
|
+
|
329
|
+
display: none;
|
330
|
+
|
331
|
+
position: fixed;
|
332
|
+
|
333
|
+
z-index: 15;
|
334
|
+
|
335
|
+
top: 30%;
|
336
|
+
|
337
|
+
left: 50%;
|
338
|
+
|
339
|
+
width: 800px;
|
340
|
+
|
341
|
+
padding: 10px;
|
342
|
+
|
343
|
+
border-radius: 8px;
|
344
|
+
|
345
|
+
-webkit-transform: translate(-50%, -10%);
|
346
|
+
|
347
|
+
transform: translate(-50%, -10%);
|
348
|
+
|
349
|
+
font-size: 1.3rem;
|
350
|
+
|
351
|
+
border: 0.3rem solid #fff;
|
352
|
+
|
353
|
+
}
|
354
|
+
|
355
|
+
.modal-back{
|
356
|
+
|
357
|
+
display: none;
|
358
|
+
|
359
|
+
position: fixed;
|
360
|
+
|
361
|
+
top: 0;
|
362
|
+
|
363
|
+
left: 0;
|
364
|
+
|
365
|
+
width: 100%;
|
366
|
+
|
367
|
+
height: 100%;
|
368
|
+
|
369
|
+
z-index: 10;
|
370
|
+
|
371
|
+
}
|
372
|
+
|
373
|
+
.modal-box{
|
374
|
+
|
375
|
+
display: flex;
|
376
|
+
|
377
|
+
justify-content: space-around;
|
378
|
+
|
379
|
+
text-align: left;
|
380
|
+
|
381
|
+
}
|
382
|
+
|
383
|
+
.modal-title{
|
384
|
+
|
385
|
+
text-align: center;
|
386
|
+
|
387
|
+
padding-bottom: 15px;
|
388
|
+
|
389
|
+
}
|
390
|
+
|
391
|
+
.modal-left{
|
392
|
+
|
393
|
+
width: 450px;
|
394
|
+
|
395
|
+
}
|
396
|
+
|
397
|
+
.modal-left,.modal-center,.modal-right{
|
398
|
+
|
399
|
+
padding: 10px;
|
400
|
+
|
401
|
+
}
|
402
|
+
|
403
|
+
body {
|
404
|
+
|
405
|
+
overflow: hidden;
|
406
|
+
|
407
|
+
margin: 0;
|
408
|
+
|
409
|
+
padding: 0;
|
410
|
+
|
411
|
+
height: 100%;
|
412
|
+
|
413
|
+
}
|
414
|
+
|
415
|
+
h1{
|
416
|
+
|
417
|
+
text-align: center;
|
418
|
+
|
419
|
+
padding-top: 20px;
|
420
|
+
|
421
|
+
}
|
422
|
+
|
423
|
+
.main{
|
424
|
+
|
425
|
+
position: relative;
|
426
|
+
|
427
|
+
text-align: center;
|
428
|
+
|
429
|
+
}
|
430
|
+
|
431
|
+
.drop{
|
432
|
+
|
433
|
+
max-width: 1200px;
|
434
|
+
|
435
|
+
display: flex;
|
436
|
+
|
437
|
+
padding-top: 20px;
|
438
|
+
|
439
|
+
}
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
button {
|
444
|
+
|
445
|
+
cursor: pointer;
|
446
|
+
|
447
|
+
-webkit-appearance: none;
|
448
|
+
|
449
|
+
-moz-appearance: none;
|
450
|
+
|
451
|
+
appearance: none;
|
452
|
+
|
453
|
+
vertical-align: middle;
|
454
|
+
|
455
|
+
color: inherit;
|
456
|
+
|
457
|
+
font: inherit;
|
458
|
+
|
459
|
+
border: 0;
|
460
|
+
|
461
|
+
background: transparent;
|
462
|
+
|
463
|
+
padding: 0;
|
464
|
+
|
465
|
+
margin: 0;
|
466
|
+
|
467
|
+
outline: none;
|
468
|
+
|
469
|
+
border-radius: 0;
|
470
|
+
|
471
|
+
}
|
472
|
+
|
473
|
+
.product-box{
|
474
|
+
|
475
|
+
display: flex;
|
476
|
+
|
477
|
+
flex-wrap: wrap;
|
478
|
+
|
479
|
+
}
|
480
|
+
|
481
|
+
.product-corner{
|
482
|
+
|
483
|
+
z-index:10;
|
484
|
+
|
485
|
+
}
|
486
|
+
|
487
|
+
.product-item{
|
488
|
+
|
489
|
+
padding-left: 10%;
|
490
|
+
|
491
|
+
padding-bottom: 20px;
|
492
|
+
|
493
|
+
width: 50%;
|
494
|
+
|
495
|
+
height: 400px;
|
496
|
+
|
497
|
+
}
|
498
|
+
|
499
|
+
.product-price{
|
500
|
+
|
501
|
+
width: 50%;
|
502
|
+
|
503
|
+
}
|
504
|
+
|
505
|
+
.product-img{
|
506
|
+
|
507
|
+
width: 300px;
|
508
|
+
|
509
|
+
height: 200px;
|
510
|
+
|
511
|
+
}
|
512
|
+
|
513
|
+
.product-img,.product-name,.product-price{
|
514
|
+
|
515
|
+
display: block;
|
516
|
+
|
517
|
+
position: relative;
|
518
|
+
|
519
|
+
}
|
520
|
+
|
521
|
+
.product-name{
|
522
|
+
|
523
|
+
font-size: 18px;
|
524
|
+
|
525
|
+
font-weight: bold;
|
526
|
+
|
527
|
+
width: 50%;
|
528
|
+
|
529
|
+
}
|
530
|
+
|
531
|
+
.info-box{
|
532
|
+
|
533
|
+
position: absolute;
|
534
|
+
|
535
|
+
}
|
536
|
+
|
537
|
+
.fav_button {
|
538
|
+
|
539
|
+
width: 123px;
|
540
|
+
|
541
|
+
height: 48px;
|
542
|
+
|
543
|
+
border: 1px solid #9F5050;
|
544
|
+
|
545
|
+
display: -webkit-box;
|
546
|
+
|
547
|
+
display: -ms-flexbox;
|
548
|
+
|
549
|
+
display: flex;
|
550
|
+
|
551
|
+
-webkit-box-align: center;
|
552
|
+
|
553
|
+
-ms-flex-align: center;
|
554
|
+
|
555
|
+
align-items: center;
|
556
|
+
|
557
|
+
-webkit-box-pack: center;
|
558
|
+
|
559
|
+
-ms-flex-pack: center;
|
560
|
+
|
561
|
+
justify-content: center;
|
562
|
+
|
563
|
+
font-size: 12px;
|
564
|
+
|
565
|
+
font-weight: bold;
|
566
|
+
|
567
|
+
letter-spacing: 0.1em;
|
568
|
+
|
569
|
+
cursor: pointer;
|
570
|
+
|
571
|
+
white-space: nowrap;
|
572
|
+
|
573
|
+
font-size: 11px;
|
574
|
+
|
575
|
+
}
|
576
|
+
|
577
|
+
#cnt{
|
578
|
+
|
579
|
+
position: relative;
|
580
|
+
|
581
|
+
left: -80px;
|
582
|
+
|
583
|
+
}
|
584
|
+
|
585
|
+
.fav_icon {
|
586
|
+
|
587
|
+
position: relative;
|
588
|
+
|
589
|
+
width: 20px;
|
590
|
+
|
591
|
+
height: 19px;
|
592
|
+
|
593
|
+
display: inline-block;
|
594
|
+
|
595
|
+
margin-right: 10px;
|
596
|
+
|
597
|
+
}
|
598
|
+
|
599
|
+
.fav_button .fav_icon:before {
|
600
|
+
|
601
|
+
content: "";
|
602
|
+
|
603
|
+
position: absolute;
|
604
|
+
|
605
|
+
top: 0;
|
606
|
+
|
607
|
+
left: 0;
|
608
|
+
|
609
|
+
right: 0;
|
610
|
+
|
611
|
+
bottom: 0;
|
612
|
+
|
613
|
+
background-image: url(../img/fav_icon.png);
|
614
|
+
|
615
|
+
background-size: contain;
|
616
|
+
|
617
|
+
background-repeat: no-repeat;
|
618
|
+
|
619
|
+
}
|
620
|
+
|
621
|
+
.is-choosen .fav_icon:before {
|
622
|
+
|
623
|
+
opacity: 0;
|
624
|
+
|
625
|
+
}
|
626
|
+
|
627
|
+
.fav_button .fav_icon:after {
|
628
|
+
|
629
|
+
content: "";
|
630
|
+
|
631
|
+
position: absolute;
|
632
|
+
|
633
|
+
top: 0;
|
634
|
+
|
635
|
+
left: 0;
|
636
|
+
|
637
|
+
right: 0;
|
638
|
+
|
639
|
+
bottom: 0;
|
640
|
+
|
641
|
+
background-image: url(../img/fav_icon_w.png);
|
642
|
+
|
643
|
+
background-size: contain;
|
644
|
+
|
645
|
+
background-repeat: no-repeat;
|
646
|
+
|
647
|
+
opacity: 0;
|
648
|
+
|
649
|
+
}
|
650
|
+
|
651
|
+
.is-choosen .fav_icon:after {
|
652
|
+
|
653
|
+
opacity: 1;
|
654
|
+
|
655
|
+
}
|
656
|
+
|
657
|
+
.cart_in{
|
658
|
+
|
659
|
+
margin-left: 10px;
|
660
|
+
|
661
|
+
padding: 5px;
|
662
|
+
|
663
|
+
border: 1px solid #228bc8;
|
664
|
+
|
665
|
+
border-radius: 30px;
|
666
|
+
|
667
|
+
}
|
668
|
+
|
669
|
+
footer{
|
670
|
+
|
671
|
+
text-align: center;
|
672
|
+
|
673
|
+
position: fixed;
|
674
|
+
|
675
|
+
bottom: 0;
|
676
|
+
|
677
|
+
left: 0;
|
678
|
+
|
679
|
+
width: 100%;
|
680
|
+
|
681
|
+
height: 35px;
|
682
|
+
|
683
|
+
padding: 10px;
|
684
|
+
|
685
|
+
}
|
686
|
+
|
687
|
+
```
|
688
|
+
|
689
|
+
|
690
|
+
|
691
|
+
```Javascript
|
692
|
+
|
693
|
+
|
694
|
+
|
695
|
+
$(function(){
|
696
|
+
|
697
|
+
$(document).on('click','.fav_button',function(){
|
698
|
+
|
699
|
+
var product_id = $(this).attr('id');
|
700
|
+
|
701
|
+
|
702
|
+
|
703
|
+
var index = String(fav).indexOf(String(product_id));
|
704
|
+
|
705
|
+
if (index > -1) {
|
706
|
+
|
707
|
+
fav = fav.replace(','+product_id, "");
|
708
|
+
|
709
|
+
fav = fav.replace(product_id, "");
|
710
|
+
|
711
|
+
} else {
|
712
|
+
|
713
|
+
fav = fav + ',' + product_id;
|
714
|
+
|
715
|
+
}
|
716
|
+
|
717
|
+
$.cookie("fav_item", fav, {
|
718
|
+
|
719
|
+
expires: 1,
|
720
|
+
|
721
|
+
path: '/'
|
722
|
+
|
723
|
+
});
|
724
|
+
|
725
|
+
checked_inspect(product_id);
|
726
|
+
|
727
|
+
});
|
728
|
+
|
729
|
+
|
730
|
+
|
731
|
+
function checked_inspect(product_id) {
|
732
|
+
|
733
|
+
fav = $.cookie("fav_item");
|
734
|
+
|
735
|
+
if (String(fav).indexOf(String(product_id)) > -1) {
|
736
|
+
|
737
|
+
$('#sumi_' + product_id).text('済');
|
738
|
+
|
739
|
+
$('#' + product_id).addClass("is-choosen");
|
740
|
+
|
741
|
+
} else {
|
742
|
+
|
743
|
+
$('#sumi_' + product_id).text('登録');
|
744
|
+
|
745
|
+
$('#' + product_id).removeClass("is-choosen");
|
746
|
+
|
747
|
+
}
|
748
|
+
|
749
|
+
}
|
750
|
+
|
751
|
+
function cart_change(){
|
752
|
+
|
753
|
+
$.post("cart_count.php", {
|
754
|
+
|
755
|
+
user_id: 1
|
756
|
+
|
757
|
+
}, function(data){
|
758
|
+
|
759
|
+
$('#cart-count').text(data.count);
|
760
|
+
|
761
|
+
});
|
762
|
+
|
763
|
+
}
|
764
|
+
|
765
|
+
$(document).on('click', '.cart_in', function(){
|
766
|
+
|
767
|
+
var product_id = $(this).val();
|
768
|
+
|
769
|
+
var cnt = $('#cnt_' + product_id + ' option:selected').text();
|
770
|
+
|
771
|
+
console.log(product_id);
|
772
|
+
|
773
|
+
console.log(cnt);
|
774
|
+
|
775
|
+
$.post("cart_in.php", {
|
776
|
+
|
777
|
+
product_id: product_id,
|
778
|
+
|
779
|
+
item_count: cnt,
|
780
|
+
|
781
|
+
user_id: 1
|
782
|
+
|
783
|
+
}, function(data){
|
784
|
+
|
785
|
+
const alert1 = alertMaker(cnt);
|
786
|
+
|
787
|
+
alert(alert1());
|
788
|
+
|
789
|
+
cart_change();
|
790
|
+
|
791
|
+
});
|
792
|
+
|
793
|
+
})
|
794
|
+
|
795
|
+
function alertMaker(cnt){
|
796
|
+
|
797
|
+
return function(){
|
798
|
+
|
799
|
+
return '商品を'+cnt+'個カートに入れました。';
|
800
|
+
|
801
|
+
}
|
802
|
+
|
803
|
+
}
|
804
|
+
|
805
|
+
$(document).on('click', '.cart-check', function(){
|
806
|
+
|
807
|
+
scroll_position = $(window).scrollTop();
|
808
|
+
|
809
|
+
$('body').addClass('fixed').css({'top' : -scroll_position});
|
810
|
+
|
811
|
+
$('.cart-modal').fadeIn();
|
812
|
+
|
813
|
+
$('.modal-back').fadeIn();
|
814
|
+
|
815
|
+
cart_show();
|
816
|
+
|
817
|
+
})
|
818
|
+
|
819
|
+
function cart_show(){
|
820
|
+
|
821
|
+
$.post("cart-show.php", {
|
822
|
+
|
823
|
+
user_id: 1
|
824
|
+
|
825
|
+
}, function(data){
|
826
|
+
|
827
|
+
console.log(data.html);
|
828
|
+
|
829
|
+
$('.cart-modal').html('<h2 class="modal-title">カートに入れた商品</h2><div>'+data.html+'</div>');
|
830
|
+
|
831
|
+
});
|
832
|
+
|
833
|
+
}
|
834
|
+
|
835
|
+
```
|
1
htmlしか載せられなかった理由を追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,6 +8,8 @@
|
|
8
8
|
|
9
9
|
3つ目、4つ目の商品名などの情報を表示されない原因はどこにあるのでしょうか。
|
10
10
|
|
11
|
+
※cssとjsは字数制限のため載せられませんでした。
|
12
|
+
|
11
13
|
|
12
14
|
|
13
15
|
```html
|