forked from tdreyno/iphone-style-checkboxes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coffee-demo.html
98 lines (95 loc) · 3 KB
/
coffee-demo.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>iPhone Style Radios Demo</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
<script src="libs/jquery.actual/jquery.actual.js"></script>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<style type="text/css">
body {
padding: 10px; }
th {
text-align: right;
padding: 4px;
padding-right: 15px;
vertical-align: top; }
.css_sized_container .iPhoneCheckContainer {
width: 250px; }
</style>
<script src="coffee/iphone-style-checkboxes.js"></script>
<script type="text/javascript">
$(window).load(function() {
var onchange_checkbox;
($('.on_off :checkbox')).iphoneStyle();
($('.disabled :checkbox')).iphoneStyle();
($('.ios5 :checkbox')).iOSCheckbox();
($('.css_sized_container :checkbox')).iphoneStyle({
resizeContainer: false,
resizeHandle: false
});
($('.long_tiny :checkbox')).iphoneStyle({
checkedLabel: 'Very Long Text',
uncheckedLabel: 'Tiny'
});
onchange_checkbox = ($('.onchange :checkbox')).iphoneStyle({
onChange: function(elem, value) {
$('span#status').html(value.toString());
}
});
setInterval(function() {
onchange_checkbox.prop('checked', !onchange_checkbox.is(':checked')).iphoneStyle("refresh");
return
}, 2500);
});
</script>
</head>
<body>
<table>
<tr class="disabled">
<th><label for="disabled">Disabled</label></th>
<td>
<input type="checkbox" id="disabled" disabled="disabled" />
</td>
</tr>
<tr class="on_off">
<th><label for="on_off">Default</label></th>
<td>
<input type="checkbox" id="on_off" />
</td>
</tr>
<tr class="ios5">
<th><label for="ios5">iOS 5</label></th>
<td>
<input type="checkbox" id="ios5" />
</td>
</tr>
<tr class="on_off">
<th><label for="on_off_on">Default On</label></th>
<td>
<input type="checkbox" checked="checked" id="on_off_on"/>
</td>
</tr>
<tr class="css_sized_container">
<th><label for="css_sized_container">CSS Sized Container and Handle</label></th>
<td>
<input type="checkbox" id="css_sized_container" />
</td>
</tr>
<tr class="long_tiny">
<th><label class="left" for="long_tiny">Long and short labels</label></th>
<td>
<input type="checkbox" id="long_tiny" />
</td>
</tr>
<tr class="onchange">
<th>Event tracking</th>
<td>
<input type="checkbox" id="onchange" />
<p>Checkbox status is <strong><span id="status">...</span></strong>.</p>
</td>
</tr>
</table>
</body>
</html>