forked from olton/metroui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrating.html
More file actions
175 lines (159 loc) · 6.09 KB
/
Copy pathrating.html
File metadata and controls
175 lines (159 loc) · 6.09 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="product" content="Metro UI CSS Framework">
<meta name="description" content="Simple responsive css framework">
<meta name="author" content="Sergey S. Pimenov, Ukraine, Kiev">
<link href="css/metro-bootstrap.css" rel="stylesheet">
<link href="css/metro-bootstrap-responsive.css" rel="stylesheet">
<link href="css/docs.css" rel="stylesheet">
<link href="js/prettify/prettify.css" rel="stylesheet">
<!-- Load JavaScript Libraries -->
<script src="js/jquery/jquery.min.js"></script>
<script src="js/jquery/jquery.widget.min.js"></script>
<script src="js/jquery/jquery.mousewheel.js"></script>
<script src="js/prettify/prettify.js"></script>
<!-- Metro UI CSS JavaScript plugins -->
<script src="js/load-metro.js"></script>
<!-- Local JavaScript -->
<script src="js/docs.js"></script>
<script src="js/github.info.js"></script>
<title>Metro UI CSS : Metro Bootstrap CSS Library</title>
</head>
<body class="metro">
<header class="bg-dark" data-load="header.html"></header>
<div class="page">
<div class="page-region">
<div class="page-region-content">
<h1>
<a href="/"><i class="icon-arrow-left-3 fg-darker smaller"></i></a>
Rating<small class="on-right">component</small>
</h1>
<p class="description">
Rating is a component that generates a customizable star rating. This component required <code>metro-rating.js</code>.
</p>
<div class="example">
<div class="rating large" data-static="false" data-score="3" data-stars="5" data-role="rating" data-show-score="true" data-score-hint="Rating: "></div>
<div id="rating_1" class="fg-green"></div>
<div class="rating small fg-red" data-static="false" data-score="3" data-stars="5" data-role="rating" data-show-score="true" data-score-hint="Value: "></div>
<script>
$(function(){
$("#rating_1").rating({
static: false,
score: 2,
stars: 5,
showHint: true,
showScore: true,
click: function(value, rating){
//alert("Rating clicked with value " + value);
rating.rate(value);
}
});
});
</script>
</div>
<h4>Component structure</h4>
<pre class="prettyprint linenums">
<div class="rating">
<ul>
<li class="rated"></li>
<li class="rated"></li>
<li></li>
<li></li>
<li></li>
</ul>
<span class="score-hint"></span>
</div>
</pre>
<h4>Component definition</h4>
<pre class="prettyprint linenums">
<div class="rating"></div>
</pre>
<p>
You can activate widget manually or auto with <code>data-*</code> api.
</p>
<h4>
Activate with API on DATA-ROLE attribute.
</h4>
<pre class="prettyprint linenums">
<div class="rating"
data-role="rating"
data-static="false"
data-score="3"
data-stars="5"
data-show-score="true"
data-score-hint="Value: ">
</div>
</pre>
<h4>
Activate with javascript.
</h4>
<pre class="prettyprint linenums">
$(function(){
$("#rating_1").rating({
static: false,
score: 2,
stars: 5,
showHint: true,
hints: ['bad', 'poor', 'regular', 'good', 'gorgeous'],
showScore: true,
scoreHint: "Current score: ",
});
});
</pre>
<h4>Event handlers</h4>
<div class="example">
<div id="rating_2" class="large fg-green"></div>
<script>
$(function(){
$("#rating_2").rating({
static: false,
score: 2,
stars: 5,
showHint: true,
showScore: true,
click: function(value, rating){
rating.rate(value);
}
});
});
</script>
</div>
<pre class="prettyprint linenums">
$(function(){
$("#rating_2").rating({
click: function(value, rating){
rating.rate(value);
}
});
});
</pre>
<h4>Change Rating color</h4>
<p class="description">
To change color of rating you can use built-in color classes <code>fg-*</code> (see colors on <a href="global.html">Global styles</a> page). Also you can change <code>color</code> style for rating element.
</p>
<pre class="prettyprint linenums">
<div class="rating fg-green"></div>
<div class="rating" style="color: #2784A7"></div>
</pre>
<h4>Change Rating size</h4>
<p class="description">
To change size of rating you can use built-in classes <code>large</code> or <code>small</code>.
</p>
<pre class="prettyprint linenums">
<div class="rating"></div>
<div class="rating large"></div>
<div class="rating small"></div>
</pre>
</div>
</div>
<div class="page-footer">
<div class="page-footer-content">
<!--<div data-load="header.html"></div>-->
</div>
</div>
</div>
<script src="js/hitua.js"></script>
</body>
</html>