This repository has been archived by the owner on Feb 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 87
/
prototype-demo.html
92 lines (85 loc) · 2.8 KB
/
prototype-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
<!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="prototype/prototype.js" type="text/javascript" charset="utf-8"></script>
<script src="prototype/scriptaculous.js" type="text/javascript" charset="utf-8"></script>
<script src="prototype/iphone-style-checkboxes.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8" />
<style type="text/css">
body {
padding: 10px;
}
label.left {
float: left;
padding: 4px;
padding-right: 15px;
}
.css_sized_container .iPhoneCheckContainer {
width: 250px;
}
ol {
list-style-type: none;
margin: 0;
padding: 0;
}
ol li {
padding: 10px;
margin: 0;
}
.onchange input {
opacity: 1 !important;
left: 100px;
}
.onchange .iPhoneCheckContainer {
overflow: visible;
}
</style>
<script type="text/javascript" charset="utf-8">
document.observe("dom:loaded", function() {
new iPhoneStyle('.on_off input[type=checkbox]');
new iPhoneStyle('.css_sized_container input[type=checkbox]', { resizeContainer: false, resizeHandle: false });
new iPhoneStyle('.long_tiny input[type=checkbox]', { checkedLabel: 'Very Long Text', uncheckedLabel: 'Tiny' });
var onchange_checkbox = $$('.onchange input[type=checkbox]').first();
new iPhoneStyle(onchange_checkbox);
setInterval(function toggleCheckbox() {
onchange_checkbox.writeAttribute('checked', !onchange_checkbox.checked);
onchange_checkbox.change();
$('status').update(onchange_checkbox.checked);
}, 2500);
});
</script>
</head>
<body>
<ol class="on_off">
<li>
<label class="left" for="on_off">Default</label>
<input type="checkbox" id="on_off" />
</li>
<li>
<label class="left" for="on_off_on">Default On</label>
<input type="checkbox" checked="checked" id="on_off_on"/>
</li>
</ol>
<ol class="css_sized_container">
<li>
<label class="left" for="css_sized_container">CSS Sized Container and Handle</label>
<input type="checkbox" id="css_sized_container"/>
</li>
</ol>
<ol class="long_tiny">
<li>
<label class="left" for="long_tiny">Long and short labels</label>
<input type="checkbox" id="long_tiny"/>
</li>
</ol>
<ol class="onchange">
<li>
<input type="checkbox" id="onchange"/>
<br />
<p>Checkbox status is <strong><span id="status">...</span></strong>.</p>
</li>
</ol>
</body>
</html>