-
Notifications
You must be signed in to change notification settings - Fork 0
/
stars.html
77 lines (60 loc) · 1.9 KB
/
stars.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
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<title>RateYo - Scratchpad</title>
<meta charset="utf-8"></meta>
<link rel="stylesheet" href="css/jquery.rateyo.min.css"/>
</head>
<body>
<div>
<div id="rateYo1" style="margin: 10px auto"></div>
<div class="counter" style="float: left;
font-weight: bold;
margin-left: 10px;
margin-top: 7px;"></div>
<div style="clear: both"></div>
</div>
<div class="rateyo-readonly-widg"></div>
<div class="rateyo"></div>
<div class="rateyo"></div>
<div class="rateyo"></div>
<div class="rateyo"></div>
<script type="text/javascript" src="js/libs/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery.rateyo.min.js"></script>
<script>
$(function () {
var rating = 1.6;
$(".counter").text(rating);
$("#rateYo1").on("rateyo.init", function () { console.log("rateyo.init"); });
$("#rateYo1").rateYo({
rating: rating,
numStars: 5,
precision: 2,
starWidth: "64px",
spacing: "5px",
multiColor: {
startColor: "#000000",
endColor : "#ffffff"
},
onInit: function () {
console.log("On Init");
},
onSet: function () {
console.log("On Set");
}
}).on("rateyo.set", function () { console.log("rateyo.set"); })
.on("rateyo.change", function () { console.log("rateyo.change"); });
$(".rateyo").rateYo();
$(".rateyo-readonly-widg").rateYo({
rating: rating,
numStars: 5,
precision: 2,
minValue: 1,
maxValue: 5
}).on("rateyo.change", function (e, data) {
console.log(data.rating);
});
});
</script>
</body>
</html>