Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 82 lines (69 sloc) 2.553 kB
9296897 @pascalopitz
authored
1 <html>
4263be0 @pascalopitz
authored
2 <head>
3 <title>Percentage</title>
4 </head>
5 <body>
6
7 <form>
8 <p>
9 <input type="text" name="input1" value="70" class="percent">
10 </p>
9296897 @pascalopitz
authored
11
4263be0 @pascalopitz
authored
12 <p>
13 <input type="text" name="input2" value="30" class="percent">
14 </p>
9296897 @pascalopitz
authored
15
4263be0 @pascalopitz
authored
16 <p>
17 <input type="text" name="input3" value="10" class="percent">
18 </p>
19
20 <p>
21 <input type="button" value="alert serialized form" id="alert-form">
22 </p>
f5950c5 @pascalopitz
authored
23
24 <p>
25 <input type="button" value="remove form percentages" id="remove-form">
26 </p>
4263be0 @pascalopitz
authored
27 </form>
28
29 <p>
30 <span class="percent">80%</span>
31 </p>
32
33 <p>
34 <input type="button" value="alert serialized span" id="alert-span">
35 </p>
9296897 @pascalopitz
authored
36
f5950c5 @pascalopitz
authored
37 <p>
38 <input type="button" value="remove span percentage" id="remove-span">
39 </p>
40
4263be0 @pascalopitz
authored
41 <p class="percent">70%</p>
42
09209cc @pascalopitz set value method
authored
43 <p>
44 <input type="button" value="update above with 50%" id="update-p">
45 </p>
46
4263be0 @pascalopitz
authored
47 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
09209cc @pascalopitz set value method
authored
48 <script type="text/javascript" src="./percentage.min.js"></script>
4263be0 @pascalopitz
authored
49 <script type="text/javascript">
50 $(document).ready(function() {
51 $('input.percent').percentage();
52 $('#alert-form').click(function() {
53 alert($(this).parents('form').serialize());
54 });
f5950c5 @pascalopitz
authored
55 $('#remove-form').click(function() {
56 $('input.percent').percentage('destroy');
57 });
4263be0 @pascalopitz
authored
58
59 $('span.percent').percentage({
60 color: 'green'
61 });
62 $('#alert-span').click(function() {
63 alert($('span.percent').text());
64 });
f5950c5 @pascalopitz
authored
65 $('#remove-span').click(function() {
66 $('span.percent').percentage('destroy');
67 });
09209cc @pascalopitz set value method
authored
68 $('#update-p').click(function() {
69 $('p.percent').percentage('set', 50);
70 });
9296897 @pascalopitz
authored
71
4263be0 @pascalopitz
authored
72 $('p.percent').percentage({
73 color: 'pink',
74 clickable: 0,
75 width: 170,
76 height: 50,
77 border: '4px solid green'
78 });
79 });
80 </script>
81 </body>
82 </html>
Something went wrong with that request. Please try again.