Skip to content

Commit

Permalink
Add index-multi demo page.
Browse files Browse the repository at this point in the history
  • Loading branch information
crossleyjuan authored and priyank-p committed May 29, 2020
1 parent ce128e3 commit e27aa11
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions index-multi.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,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>

0 comments on commit e27aa11

Please sign in to comment.