forked from jupiterjs/jquerymx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtie.html
More file actions
72 lines (61 loc) · 1.67 KB
/
tie.html
File metadata and controls
72 lines (61 loc) · 1.67 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>tie</title>
<style type='text/css'>
body {font-family: verdana}
.error {border: solid 1px red;}
.error_text { color: red; font-size: 10px;}
td {padding: 3px;}
#sliderWrapper {
border: solid 1px gray;
width: 300px;
height: 30px;
}
.mxui_slider {
width: 30px;
height: 30px;
background-color: green;
}
</style>
</head>
<body>
<div id='sliderWrapper'><div id='age1'></div></div>
<input type='text' id='age2' />
<textarea id='age3'></textarea>
<select id='age4'>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
<option value='7'>7</option>
<option value='8'>8</option>
<option value='9'>9</option>
<option value='10'>10</option>
</select>
<script type='text/javascript'
src='../../steal/steal.js'>
</script>
<script type='text/javascript'>
steal.plugins('jquery/model','jquery/tie','mxui/slider').start()
</script>
<script type='text/javascript'>
$.Model.extend("Person",{
setAge : function(age, success, error){
age = +(age);
if(isNaN(age) || !isFinite(age) || age < 1 || age > 10){
error()
}else{
return age;
}
}
});
person = new Person({age: 1});
$("#age1").mxui_slider({interval: 1, min: 1, max: 10});
$("#age1, #age2, #age3, #age4").tie(person,"age")
</script>
</body>
</html>