forked from priyank-p/simplepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-multi.html
78 lines (67 loc) · 2.17 KB
/
index-multi.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="dist/simplepicker.css">
<title>simplepicker</title>
<style>
.event-log {
font-family: consolas, Monaco, monospace;
margin: 10px 5px;
line-height: 2;
border: 1px solid #4c4c4c;
height: auto;
width: 90%;
padding: 2px 6px;
color: #4c4c4c;
white-space: pre;
}
.btn {
border: none;
background: transparent;
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 16px;
padding: 7px 14px;
border: 1px solid #ddd;
margin: 0 5px;
border-color: #016565;
color: #016565;
font-size: 13px;
}
</style>
</head>
<body>
<input type="text" id="test1" /><button class="btn button-1">Show Picker</button>
<div class="picker-1"></div>
<br>
<input type="text" id="test2" /><button class="btn button-2">Show Picker</button>
<div class="picker-2"></div>
<script src="dist/simplepicker.js"></script>
<script>
let simplepicker1 = new SimplePicker(".picker-1", {
zIndex: 10
});
let simplepicker2 = new SimplePicker(".picker-2", {
zIndex: 10
});
const $button1 = document.querySelector('.button-1');
$button1.addEventListener('click', (e) => {
simplepicker1.open();
});
simplepicker1.on("submit", function (date, readableDate) {
var input = document.querySelector('#test1');
input.value = readableDate;
});
const $button2 = document.querySelector('.button-2');
$button2.addEventListener('click', (e) => {
simplepicker2.open();
});
simplepicker2.on("submit", function (date, readableDate) {
var input = document.querySelector('#test2');
input.value = readableDate;
});
</script>
</body>
</html>