-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
executable file
·54 lines (49 loc) · 2.54 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Countdown</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript" src="jquery.countdown.min.js"></script>
<style type="text/css">
.number {padding: 0 5px 0 10px;}
</style>
</head>
<body>
<h4>Example use data-timer</h4>
<div class="demo1" data-timer="75149185"></div>
<h4>Example use data-y data-m ...</h4>
<div class="demo2" data-y="2030" data-m="5" data-d="26" data-h="00" data-i="00" data-s="0"></div>
<h4>Example use private layout</h4>
<div class="demo3" data-timer="5-26-2030">
<span class="box-count day"><span class="number">0</span><span class="text">Ngày</span></span>
<span class="box-count hrs"><span class="number">0</span><span class="text">Giờ</span></span>
<span class="box-count min"><span class="number">0</span><span class="text">Phút</span></span>
<span class="box-count secs"><span class="number">0</span> <span class="text">Giây</span></span>
</div>
<h4>Example use private layout with attribute data</h4>
<div class="demo4" data-timer="5/26/2030"
data-layout='<span class="box-count day"><span class="number">0</span><span class="text">Ngày</span></span><span class="box-count hrs"><span class="number">0</span><span class="text">Giờ</span></span><span class="box-count min"><span class="number">0</span><span class="text">Phút</span></span><span class="box-count secs"><span class="number">0</span> <span class="text">Giây</span></span>',
>
</div>
<script type="text/javascript">
$(document).ready(function() {
/* example 1 */
$('.demo1').countdown();
/* example 2 */
$('.demo2').each(function () {
var $counter = $(this);
var austDay = new Date($counter.data('y'), $counter.data('m') - 1, $counter.data('d'), $counter.data('h'), $counter.data('i'), $counter.data('s'));
// austDay = '2022-12-12';
$counter.countdown({
until: austDay
});
});
/* example 3 custom layout */
$('.demo3').countdown();
/* example 4 custom layout with attribute data*/
$('.demo4').countdown();
});
</script>
</body>
</html>