forked from devcon2017/devcon2017.github.io
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
83 lines (64 loc) · 1.31 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
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
79
80
81
82
83
<button onclick="update()">Test</button>
<br><br><br><br>
<div id="ldBar1" style="width:10%; height: 20px; float: left"></div>
<div id="ldBar2" style="width:10%; height: 20px; float: right"></div>
<script src="./js/jquery-1.7.2.min.js"></script>
<script src="./js/progressbar.min.js"></script>
<script type="text/javascript">
var bar1 = new ProgressBar.Circle('#ldBar1', {
strokeWidth: 6,
easing: 'easeInOut',
duration: 1400,
color: '#000',
trailColor: '#eee',
trailWidth: 1,
svgStyle: null,
text: {
style: {
color: '#000',
position: 'absolute',
left: '50px',
top: '50px',
padding: 0,
margin: 0,
transform: null
}
}
});
var bar2 = new ProgressBar.Circle('#ldBar2', {
strokeWidth: 6,
easing: 'easeInOut',
duration: 1400,
color: 'red',
trailColor: '#eee',
trailWidth: 1,
svgStyle: null,
text: {
style: {
color: '#000',
position: 'absolute',
left: '50px',
top: '50px',
padding: 0,
margin: 0,
transform: null
}
}
});
var a = true;
function update() {
if (a) {
bar1.setText(23.5);
bar1.animate(0.3);
bar2.setText(60);
bar2.animate(0.753);
a = false;
} else {
bar1.setText(92.5);
bar1.animate(0.9);
bar2.setText(30);
bar2.animate(0.35);
a = true;
}
}
</script>