回答編集履歴

2

追記しました

2017/11/25 15:15

投稿

namnium1125
namnium1125

スコア2043

test CHANGED
@@ -89,3 +89,153 @@
89
89
  </html>
90
90
 
91
91
  ```
92
+
93
+
94
+
95
+ ## 追記
96
+
97
+
98
+
99
+ 作ってみたので参考にどうぞ。
100
+
101
+
102
+
103
+ ```html
104
+
105
+ <!DOCTYPE html>
106
+
107
+ <html>
108
+
109
+ <head>
110
+
111
+ <meta charset="utf-8">
112
+
113
+ <title>fade-in</title>
114
+
115
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
116
+
117
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
118
+
119
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
120
+
121
+ <style>
122
+
123
+ .carousel-inner {
124
+
125
+ padding: 0;
126
+
127
+ }
128
+
129
+ .carousel-caption {
130
+
131
+ bottom: 25%;
132
+
133
+ display: none;
134
+
135
+ }
136
+
137
+ </style>
138
+
139
+ <script>
140
+
141
+ $(function() {
142
+
143
+ $(".carousel-caption").fadeIn();
144
+
145
+ $("#carousel-example-generic").on("slide.bs.carousel",function() {
146
+
147
+ $(".carousel-caption").fadeOut("fast");
148
+
149
+ });
150
+
151
+ $("#carousel-example-generic").on("slid.bs.carousel",function() {
152
+
153
+ $(".carousel-caption").fadeIn();
154
+
155
+ });
156
+
157
+ });
158
+
159
+ </script>
160
+
161
+ </head>
162
+
163
+ <body>
164
+
165
+ <section class="carousel-size">
166
+
167
+ <div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="8000">
168
+
169
+ <div class="carousel-inner"><!-- 変更 -->
170
+
171
+ <div class="item active">
172
+
173
+ <img src="images/slide1.jpg" alt="slide1" width="100%">
174
+
175
+ <div class="carousel-caption">
176
+
177
+ 古くから、<br>料理する場、<br>暖をとる場として<br>家族の中心に置かれてきた囲炉裏。
178
+
179
+ </div>
180
+
181
+ </div>
182
+
183
+ <div class="item">
184
+
185
+ <img src="images/slide2.jpg" alt="slide2" width="100%">
186
+
187
+ <div class="carousel-caption">
188
+
189
+ 鉄瓶にゆらゆらと立ち上る湯気、<br>時折ぱちぱちと爆ぜる炭を<br>眺めていると、<br>時間がゆっくり、ゆっくりと<br>流れていきます。
190
+
191
+ </div>
192
+
193
+ </div>
194
+
195
+ <div class="item">
196
+
197
+ <img src="images/slide3.jpg" alt="slide3" width="100%">
198
+
199
+ <div class="carousel-caption">
200
+
201
+ 囲炉裏を囲み、<br>家族が心の中から温まる、<br>そんな場所を作りたくて始めました。
202
+
203
+ </div>
204
+
205
+ </div>
206
+
207
+ <div class="item">
208
+
209
+ <img src="images/slide4.jpg" alt="slide4" width="100%">
210
+
211
+ <div class="carousel-caption">
212
+
213
+ 1つ1つ丁寧に作られた囲炉裏は、<br>あなただけの、<br>世界にたった1つの作品となります。<br>是非、囲炉裏の持つ独自な趣を、<br>体感してください。
214
+
215
+ </div>
216
+
217
+ </div>
218
+
219
+ </div>
220
+
221
+ <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
222
+
223
+ <span class="glyphicon glyphicon-chevron-left"></span>
224
+
225
+ </a>
226
+
227
+ <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
228
+
229
+ <span class="glyphicon glyphicon-chevron-right"></span>
230
+
231
+ </a>
232
+
233
+ </div>
234
+
235
+ </section>
236
+
237
+ </body>
238
+
239
+ </html>
240
+
241
+ ```

1

追記しました

2017/11/25 15:15

投稿

namnium1125
namnium1125

スコア2043

test CHANGED
@@ -2,11 +2,21 @@
2
2
 
3
3
 
4
4
 
5
- また[要素指定](http://www.detelu.com/blog/2011/11/jquery-selector-traversing/)がおかしいです。
5
+ - [要素指定](http://www.detelu.com/blog/2011/11/jquery-selector-traversing/)がおかしいです。
6
+
7
+ この場合`.left carousel-control`ではなく`.left`でいいはずです。
6
8
 
7
9
 
8
10
 
11
+ - `$`をつけ忘れています。またクラスを示す`.`がありません。
12
+
9
- この場合`.left carousel-control`ではなく`.left`でいいはずです。
13
+ × : `("carousel-caption").fadeIn();`
14
+
15
+ ○ : `$(".carousel-caption").fadeIn();`
16
+
17
+
18
+
19
+
10
20
 
11
21
 
12
22