-
Notifications
You must be signed in to change notification settings - Fork 21
/
index.html
42 lines (34 loc) · 1.07 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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>smiley-slider</title>
<style type="text/css">
</style>
</head>
<body>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="smiley-slider.js"></script>
<script>
$(function () {
var s = new SmileySlider(document.getElementById("slider"))
s.position(0) // make it sad
s.position(1) // make it happy
var p = s.position() // get it's position
s.position(p / 2) // make it half as happy
s.position(function (p) {
// do something when it changes
})
$.ajax({
url : 'http://view-count.herokuapp.com/view/' + encodeURIComponent(location.href),
xhrFields : { withCredentials: true },
success : function (count) { }
})
})
</script>
<table style="width:329px;margin-left:auto;margin-right:auto">
<tr><td><div id="slider" style="margin-top:100px;margin-bottom:100px;"></div></td></tr>
<tr><td align="center"><small><a href="https://github.com/dglittle/smiley-slider">source code</a></small></td></tr>
</table>
</body>
</html>