-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce128e3
commit e27aa11
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |