-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
160 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Counter</title> | ||
<meta name="viewport" content="width=device-width"> | ||
<style> | ||
.container { | ||
width: 450px; | ||
margin: 0 auto; | ||
text-align: center; | ||
} | ||
|
||
.gauge { | ||
width: 450px; | ||
height: 450px; | ||
} | ||
|
||
a:link.button, | ||
a:active.button, | ||
a:visited.button, | ||
a:hover.button { | ||
margin: 30px 5px 0 2px; | ||
padding: 7px 13px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<h1>Gauge with Target Line</h1> | ||
<div id="g1" class="gauge"></div> | ||
<a href="#" id="g1_refresh">Random Refresh</a> | ||
</div> | ||
<script src="../raphael.min.js"></script> | ||
<script src="../../justgage.js"></script> | ||
<script> | ||
var g1; | ||
/** Random integer */ | ||
function getRandomInt(min, max) { | ||
return Math.floor(Math.random() * (max - min + 1)) + min; | ||
} | ||
|
||
document.addEventListener("DOMContentLoaded", function (event) { | ||
g1 = new JustGage({ | ||
id: "g1", | ||
value: 72, | ||
min: 0, | ||
minTxt: 0, | ||
max: 100, | ||
maxTxt: 100, | ||
targetLine:25, | ||
targetLineWidth: 4, | ||
targetLineColor: "#000", | ||
}); | ||
|
||
document.getElementById('g1_refresh').addEventListener('click', function () { | ||
g1.refresh(getRandomInt(0, 100)); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters