forked from olton/metroui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogress-bar.html
More file actions
133 lines (129 loc) · 5.51 KB
/
Copy pathprogress-bar.html
File metadata and controls
133 lines (129 loc) · 5.51 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<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="container">
<h1> <a href="/"><i class="icon-arrow-left-3 fg-darker smaller"></i></a> Progress Bar<small class="on-right">component</small> </h1>
<p class="description"> This component require <code>metro-progressbar.js</code>. </p>
<div class="example">
<div class="progress-bar" data-role="progress-bar" data-value="10"></div>
<div class="progress-bar" data-role="progress-bar" data-value="20" data-color="bg-green"></div>
<div class="progress-bar" data-role="progress-bar" data-value="50" data-color="bg-red"></div>
<div class="progress-bar" data-role="progress-bar" data-value="75" data-color="bg-pink"></div>
<div class="progress-bar" data-role="progress-bar" data-value="100" data-color="#ccc"></div>
</div>
<pre class="prettyprint linenums">
<div class="progress-bar" data-role="progress-bar" data-value="10"></div>
<div class="progress-bar" data-role="progress-bar" data-color="bg-green"></div>
<div class="progress-bar" data-role="progress-bar" data-color="#ccc"></div>
</pre>
<h3>Any size for progress bar</h3>
<div class="example">
<div class="progress-bar small" data-role="progress-bar" data-value="10"></div>
<div class="progress-bar" data-role="progress-bar" data-value="20" data-color="bg-green"></div>
<div class="progress-bar large" data-role="progress-bar" data-value="50"></div>
</div>
<pre class="prettyprint linenums">
<div class="progress-bar small"></div>
<div class="progress-bar"></div>
<div class="progress-bar large"></div>
</pre>
<p class="description"> You can activate widget manually or auto with <code>data-*</code> api. </p>
<h4>Activate widget with Javascript</h4>
<pre class="linenums prettyprint">
$("#componennt_id").progressbar({
value: int // progress value, default 0
color: string, // existing class (bg-*) or color schema (#NNNNNN)
onchange: function(val){...}
});
</pre>
<h4>Set value with Javascript</h4>
<div class="example">
<div class="progress-bar small" data-role="progress-bar" id="pb1"></div>
<button class="button success" id="pb_start_btn">Start</button>
<button class="button " id="pb_reset_btn">Reset</button>
<script>
$(function(){
var pb = $('#pb1').progressbar();
var progress = 0;
$("#pb_start_btn").on('click', function(){
var interval = setInterval(
function(){
pb.progressbar('value', (++progress));
if (progress == 100) window.clearInterval(interval);
}, 100);
});
$("#pb_reset_btn").on('click', function(){
progress = 0;
pb.progressbar('value', progress);
});
});
</script>
</div>
<pre class="linenums prettyprint">
var pb = $("#componennt_id").progressbar();
pb.progressbar('value', 75);
</pre>
<h4>Set color with Javascript</h4>
<pre class="linenums prettyprint">
var pb = $("#componennt_id").progressbar();
pb.progressbar('color', '#000');
</pre>
<h4>Activate widget with API</h4>
<pre class="prettyprint linenums">
<div class="progress-bar"
data-role="progress-bar"
data-value="75"
data-color="bg-pink"></div>
</pre>
<h4>Options</h4>
<p> Slider supported next options: </p>
<table class="table border">
<tr>
<td class="text-bold">value</td>
<td class="text-bold">data-value</td>
<td>Set a new position and progress of the progress bar.</td>
</tr>
<tr>
<td class="text-bold">color</td>
<td class="text-bold">data-color</td>
<td>Set the color of the progress bar.</td>
</tr>
<tr>
<td class="text-bold">animate</td>
<td class="text-bold">data-animate</td>
<td>Animate progress value changes of the progress bar.</td>
</tr>
<tr>
<td class="text-bold">max</td>
<td class="text-bold">data-max</td>
<td>Optionally set the maximum value of the progress bar to be below 100.</td>
</tr>
</table>
<p> You can sets options over javascript or data-* api. </p>
</div>
<script src="js/hitua.js"></script>
</body>
</html>