forked from jesucarr/jOdometer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
59 lines (52 loc) · 1.44 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jOdometer jQuery plugin</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
#counter {
height: 50px;
width: 224px;
border: 1px solid brown;
background: black;
color: white;
/* could also go under #counter .jodometer_digit */
font-weight: bold;
font-size: 36px;
font-family: 'lucida grande', 'lucida sans unicode', arial, sans-serif;
text-align: center;
}
</style>
</head>
<body>
styled:
<div id="counter"></div>
<input type="button" value="increment" onclick="increment()"/>
<hr>
default:
<div id="counter_default"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="jquery.jodometer.js" type="text/javascript"></script>
<script type="text/javascript">
(function($){
var counter = $('#counter').jOdometer({
increment: 0,
counterStart: '00000000',
spaceNumbers: 2,
offsetRight: 5,
heightNumber: 50,
widthNumber: 24,
formatNumber: true,
trimZero: true
});
$('#counter_default').jOdometer({});
//counter.goToNumber(1);
var nextVal = 0;
increment = function() {
nextVal += Math.random() * 15000;
counter.goToNumber(nextVal);
}
})(jQuery);
</script>
</body>
</html>