-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
44 lines (44 loc) · 1.23 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="jsmodal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jsmodal.js"></script>
<script type="text/javascript">
window.open_dialog = function() {
var modal = new JSModal('modal');
var formElem = document.createElement('div');
var labelElem = document.createElement('span');
labelElem.textContent = 'Name:';
var nameInput = document.createElement('input');
nameInput.value = '';
formElem.appendChild(labelElem);
formElem.appendChild(nameInput);
modal.setBody(formElem)
modal.ok(function() {
console.log('ok');
});
modal.open();
}
</script>
</head>
<body>
<div style="width:100%;height:1024px;">
<button onClick="open_dialog();">ダイアログを開く</button>
</div>
<div>
<div id="modal" class="jsmodal-window">
<a class="close" href="#">x</a>
<div class="jsmodal-window-header">
<h1>モーダル</h1>
</div>
<div class="jsmodal-window-body">
テクニカルロックスターズのモーダルです。
<button>OK</button>
</div>
</div>
</div>
</body>
</html>