質問編集履歴

1

質問の加筆

2017/01/06 00:39

投稿

yoso
yoso

スコア27

test CHANGED
File without changes
test CHANGED
@@ -18,25 +18,125 @@
18
18
 
19
19
 
20
20
 
21
-
21
+ ```#modal-overlay {
22
-
23
-
24
-
22
+
25
- ```ここに言語を入力
23
+ z-index: 1;
24
+
26
-
25
+ display: none;
26
+
27
-
27
+ position: fixed;
28
+
28
-
29
+ top: 0;
30
+
31
+ left: 0;
32
+
33
+ width: 100%;
34
+
35
+ height: 100%;
36
+
37
+ background-color: rgba( 255,255,255, 0.75 );
38
+
39
+ }
40
+
41
+
42
+
43
+ #modal-content {
44
+
45
+ width: 910px;
46
+
47
+ height: 360px;
48
+
49
+ margin: 0;
50
+
51
+ padding: 20px 20px;
52
+
53
+ border: 0px solid #aaa;
54
+
55
+ background: #fff;
56
+
57
+ position: fixed;
58
+
59
+ /*display: none;*/
60
+
61
+ }
62
+
63
+ .button-link {
64
+
65
+ color: #00f ;
66
+
67
+ text-decoration: underline;
68
+
69
+ }
70
+
71
+
72
+
73
+ .button-link:hover {
74
+
75
+ cursor: pointer ;
76
+
77
+ color: #f00 ;
78
+
79
+ }
80
+
81
+
82
+
83
+ .css_btn_class {
84
+
85
+ font-size:16px;
86
+
87
+ font-family:Arial;
88
+
89
+ font-weight:normal;
90
+
91
+ -moz-border-radius:8px;
92
+
93
+ -webkit-border-radius:8px;
94
+
95
+ border-radius:8px;
96
+
97
+ border:0px solid #d83526;
98
+
99
+ padding:9px 18px;
100
+
101
+ text-decoration:none;
102
+
103
+ background:-moz-linear-gradient( center top, #fe1a00 5%, #ce0100 100% );
104
+
105
+ background:-ms-linear-gradient( top, #fe1a00 5%, #ce0100 100% );
106
+
107
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fe1a00', endColorstr='#ce0100');
108
+
109
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(5%, #fe1a00), color-stop(100%, #ce0100) );
110
+
111
+ background-color:#fe1a00;
112
+
113
+ color:#ffffff;
114
+
115
+ display:inline-block;
116
+
117
+ }
118
+
119
+
120
+
121
+
122
+
123
+ </STYLE>
124
+
125
+
126
+
127
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
128
+
29
- <script>
129
+ <script>
30
-
31
-
32
-
130
+
131
+
132
+
33
- jQuery(function() {
133
+ $(function() {
34
134
 
35
135
  // modal-overlay内にmodal-contentを配置しているためイベントバブルにより、
36
136
 
37
137
  // modal-overlayのクリック(タッチ)イベントが発生してしまうためバブリングを停止させる
38
138
 
39
- jQuery("#modal-content").click(function(evt) {
139
+ $("#modal-content").click(function(evt) {
40
140
 
41
141
  evt.stopPropagation();
42
142
 
@@ -44,11 +144,11 @@
44
144
 
45
145
  //リサイズされたら、センタリングをする
46
146
 
47
- jQuery(window).resize(centeringModalSyncer);
147
+ $(window).resize(centeringModalSyncer);
48
148
 
49
149
  //ボタンのクリック(タッチ)イベント
50
150
 
51
- jQuery(".modal-syncer").click(function() {
151
+ $(".modal-syncer").click(function() {
52
152
 
53
153
  //ボタンからフォーカスを外す
54
154
 
@@ -56,11 +156,11 @@
56
156
 
57
157
  //プレイヤー(iframe)のsrcにYouTube動画のURLを設定
58
158
 
59
- jQuery("#vimeoPlayer").attr("src", "https://www.youtube.com/embed/" + jQuery(this).data("videoId") + "?autoplay=0");
159
+ $("#vimeoPlayer").attr("src", "https://www.youtube.com/embed/" + $(this).data("videoId") + "?autoplay=0");
60
-
160
+
61
- jQuery("#modal-overlay").fadeIn("slow");
161
+ $("#modal-overlay").fadeIn("slow");
62
-
162
+
63
- jQuery("#modal-content img").attr("src", jQuery(this).data("description"));
163
+ $("#modal-content img").attr("src", $(this).data("description"));
64
164
 
65
165
  // センタリング
66
166
 
@@ -72,13 +172,13 @@
72
172
 
73
173
  //[#modal-overlay]、または[#modal-close]をクリックしたら…
74
174
 
75
- jQuery("#modal-overlay, #modal-close").click(function() {
175
+ $("#modal-overlay, #modal-close").click(function() {
76
176
 
77
177
  //[#modal-content]と[#modal-overlay]をフェードアウトした後に…
78
178
 
79
- jQuery("#modal-overlay").fadeOut("slow", function() {
179
+ $("#modal-overlay").fadeOut("slow", function() {
80
-
180
+
81
- jQuery("#vimeoPlayer").attr("src", ""); // プレイヤーのsrcをクリア
181
+ $("#vimeoPlayer").attr("src", ""); // プレイヤーのsrcをクリア
82
182
 
83
183
  });
84
184
 
@@ -90,19 +190,19 @@
90
190
 
91
191
  //画面(ウィンドウ)の幅、高さを取得
92
192
 
93
- var w = jQuery(window).width();
193
+ var w = $(window).width();
94
-
194
+
95
- var h = jQuery(window).height();
195
+ var h = $(window).height();
96
196
 
97
197
  //コンテンツ(#modal-content)の幅、高さを取得
98
198
 
99
- var cw = jQuery("#modal-content").outerWidth();
199
+ var cw = $("#modal-content").outerWidth();
100
-
200
+
101
- var ch = jQuery("#modal-content").outerHeight();
201
+ var ch = $("#modal-content").outerHeight();
102
202
 
103
203
  //センタリングを実行する
104
204
 
105
- jQuery("#modal-content").css({ left: ((w - cw) / 2), top: ((h - ch) / 2) });
205
+ $("#modal-content").css({ left: ((w - cw) / 2), top: ((h - ch) / 2) });
106
206
 
107
207
  }
108
208
 
@@ -118,6 +218,64 @@
118
218
 
119
219
 
120
220
 
121
-
221
+ <div id="modal-overlay">
222
+
223
+ <div id="modal-content">
224
+
225
+ <iframe src="" width="512" height="288" align="left" frameborder="0" id="vimeoPlayer" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" style="display: block;" padding_right="10"></iframe>
226
+
227
+ <img src="説明文書画像" alt="0" width="350" height="283" size-full wp-image-117 />
228
+
229
+ <a id="modal-close" class="button-link css_btn_class">閉じる</a>
230
+
231
+ </div>
232
+
233
+ </div>
234
+
235
+ <!-- モーダルウィンドウのコンテンツ終了 -->
236
+
237
+ <table>
238
+
239
+ <tr>
240
+
241
+ <td>
242
+
243
+ <a class="modal-syncer button-link css_btn_class" data-video-id="Pii-LaWOyuo">動画1</a>
244
+
245
+ </td>
246
+
247
+ <td>
248
+
249
+ <a class="modal-syncer button-link css_btn_class" data-video-id="FajnnR-9mhE">動画2</a>
250
+
251
+ </td>
252
+
253
+ </tr>
254
+
255
+ <tr>
256
+
257
+ <td>
258
+
259
+ <a class="modal-syncer button-link css_btn_class" data-video-id="OC7tgJP1D4s">動画3</a>
260
+
261
+ </td>
262
+
263
+ <td>
264
+
265
+ <a class="modal-syncer button-link css_btn_class" data-video-id="OC7tgJP1D4s">動画4</a>
266
+
267
+ </td>
268
+
269
+ </tr>
270
+
271
+ </table>
122
272
 
123
273
  ```
274
+
275
+
276
+
277
+ 上記を使わせていただき作成致しました。
278
+
279
+
280
+
281
+ 質問形式も分かっておらず申し訳ありませんが、よろしくお願いいたします。