-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.html
40 lines (37 loc) · 1.02 KB
/
test.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<div id="control">
<div class="sensitivity" id="sensitivity">
<div class="line" id="line">
<div class="progress" id="progress"></div>
</div>
<div class="dot"></div>
</div>
</div>
<input id="input" type="text">
<script src="./Slide.js"></script>
<script>
let father = document.querySelector("#control");
let a = new Slide(true, true, father);
a.render();
document.addEventListener("slide", (e) => {
document.querySelector("#input").value = parseInt(a.getPercentage());
});
/* a.render(change);
//为了监听滑动条改变
function change() {
document.querySelector("#input").value = parseInt(a.getPercentage());
}*/
//监听输入框改变
document.querySelector("#input").onkeyup = () => {
a.setData(document.querySelector("#input").value)
}
</script>
</body>
</html>