teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

htmlとcssのコードも記載します。

2018/05/22 14:56

投稿

nenechi
nenechi

スコア6

title CHANGED
File without changes
body CHANGED
@@ -38,9 +38,149 @@
38
38
  btnNext.click(function(){switchNext();});
39
39
  btnPrev.click(function(){switchPrev();});
40
40
  }
41
+ ```
42
+ ```html
43
+ <!doctype html>
44
+ <html>
45
+ <head>
46
+ <meta charset="utf-8">
47
+ <title>架空旅館サイト</title>
48
+ <link rel="stylesheet" href="style.css">
49
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bitter:400;700">
50
+ <script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
51
+ <script src="js/script.js"></script>
41
52
 
53
+ </head>
54
+
55
+ <body>
56
+
57
+ <header>
58
+ <div class="logo">
59
+ <a href="">
60
+ <h1>架空旅館サイト</h1>
61
+ </a>
62
+ </div>
63
+
64
+ <nav>
65
+ <ul>
66
+ <li></li>
67
+ <li><a href="">客室</a></li>
68
+ <li><a href="">お食事</a></li>
69
+ <li><a href="">船外体験</a></li>
70
+ <li><a href="">ブログ</a></li>
71
+ <li><a href="">アクセス</a></li>
72
+ </ul>
73
+ </nav>
74
+ </header>
75
+
76
+ <div class="slideshow">
77
+ <ul>
78
+ <li><img src="img/img01.png" alt=""></li>
79
+ <li><img src="img/img02.png" alt=""></li>
80
+ <li><img src="img/img03.png" alt=""></li>
81
+ </ul>
82
+ </div>
83
+
84
+
85
+ </body>
86
+ </html>
87
+
88
+
89
+
42
90
  ```
43
91
 
92
+ ```css
93
+
94
+ .slideshow ul {
95
+ width: 100%;
96
+ }
97
+
98
+ .slideshow ul li {
99
+ top: 150px;
100
+ left: 0;
101
+ width: 100%;
102
+ display: none;
103
+ position: absolute;
104
+ }
105
+
106
+ .slideshow ul li img {
107
+ width: 100%;
108
+ }
109
+
110
+ @media only screen and (max-width: 1020px) {
111
+ .slideshow {
112
+ width: 100%;
113
+ }
114
+ }
115
+
116
+ .pagiNation {
117
+ bottom: 20px;
118
+ left: 0;
119
+ width: 100%;
120
+ height: 15px;
121
+ text-align: center;
122
+ position: absolute;
123
+ z-index: 110;
124
+ }
125
+
126
+ .pagiNation a {
127
+ margin: 0;
128
+ width: 15px;
129
+ height: 15px;
130
+ display: inline-block;
131
+ overflow: hidden;
132
+ background: #aaa;
133
+ border: #fff 2px solid;
134
+ border-radius: 50%;
135
+ transition: all 0.2s ease-in-out;
136
+ }
137
+
138
+ .pagiNation a:hover {
139
+ opacity: 0.6;
140
+ }
141
+
142
+ .pagiNation a.pnActive {
143
+ background: #000;
144
+ }
145
+
146
+ .pagiNation a.pnActive:hover {
147
+ opacity: 1;
148
+ }
149
+
150
+ .slideshow .btnPrev,
151
+ .slideshow .btnNext {
152
+ margin-top: -25px;
153
+ top: 50%;
154
+ width: 50px;
155
+ height: 50px;
156
+ position: absolute;
157
+ z-index: 105;
158
+ transition: all 0.2s ease-in-out;
159
+ }
160
+
161
+ .slideshow .btnPrev {
162
+ left: 15px;
163
+ background: transparent url(../img/btnPrev.png)
164
+ no-repeat center center;
165
+ }
166
+
167
+ .slideshow .btnNext {
168
+ right: 15px;
169
+ background: transparent url(../img/btnNext.png)
170
+ no-repeat center center;
171
+ }
172
+
173
+ .slideshow .btnPrev:hover,
174
+ .slideshow .btnNext:hover {
175
+ opacity: 0.6;
176
+ }
177
+
178
+
179
+ ```
180
+
181
+
182
+
183
+
44
184
  ### 試したこと
45
185
  ネットでエラーメッセージを調べましたが、日本語の参考になるサイトがほとんどなく、私がJSについて初心者なので意味がいまいちわかりません。
46
186
  参考書のサンプルコードも上記のコードと同じで、エラーがでています。jQueryも参考書とバージョンを合わせています。何かしらのバージョンの問題なのかもしれませんが、お助け下さい。