-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
67 lines (53 loc) · 1.48 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>
CREATE A CUSTOM PROGRESS BAR USING HTML5
</title>
<link rel="stylesheet" href="css/style.css">
<script src="js/jquery.min.js"></script>
<script src="js/modernizr.js" type="text/javascript"></script>
<script>
$(() => {
if (!Modernizr.meter) {
alert('Sorry your brower does not support HTML5 progress bar');
} else {
let progressbar = $('#progressbar');
let max = progressbar.attr('max');
let time = (1000 / max) * 5;
let value = progressbar.val();
const loading = () => {
value += 1;
progressbar.val(value);
$('.progress-value').html(value + '%');
if (value == max) {
clearInterval(animate);
}
};
const animate = setInterval(() => loading(), time);
};
});
</script>
</head>
<body>
<div align='center'>
<h1>CUSTOM PROGRESS BAR USING HTML5</h1>
<p>This demo shows how to use the new HTML5 element <progress> to create animated progress bar.</p>
</div>
<div class="demo-wrapper html5-progress-bar">
<div class="progress-bar-wrapper">
<progress id="progressbar" value="0" max="100"></progress>
<span class="progress-value">0%</span>
</div>
</div>
<br />
<br />
<br />
<div align='center'>
Full Article: <a class="dark-link dark-hover6"
href="https://www.mushfiqweb.com/custom-progress-bar-using-html5/">CREATE A CUSTOM PROGRESS BAR USING
HTML5</a>
</div>
</body>
</html>