-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathindex.plainjs.html
More file actions
48 lines (42 loc) · 1.63 KB
/
index.plainjs.html
File metadata and controls
48 lines (42 loc) · 1.63 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Slide Unlock</title>
<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, user-scalable=no">
<!-- css -->
<link rel="stylesheet" type="text/css" href="css/normalize.css">
<link rel="stylesheet" type="text/css" href="css/slideunlock.css">
</head>
<body>
<div class="slideunlock-wrapper">
<input type="hidden" value="" class="slideunlock-lockable" />
<div class="slideunlock-slider">
<span class="slideunlock-label"></span>
<span class="slideunlock-lable-tip">Slide to unlock!</span>
</div>
</div>
<button id="reset-btn">Reset</button>
<p class="warn"></p>
<script type="text/javascript" src="js/slideunlock.js"></script>
<script type="text/javascript">
window.onload = function () {
var slider = new SliderUnlock(".slideunlock-slider", {}, function () {
alert('success');
}, function () {
document.querySelector(".warn").innerText = "index:" + slider.index +
", max:" + slider.max +
", lableIndex:" + slider.lableIndex +
", value:" + document.querySelector(".slideunlock-lockable").value +
", date:" + new Date().getUTCDate();
});
slider.init();
document.querySelector("#reset-btn").addEventListener('click', function () {
slider.reset();
});
}
</script>
</body>
</html>