blob: 2d9d8232c86dc66bd8bbd1ad41381484f3ed527e (
plain)
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
|
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Selectmenu - Product Selection</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../jquery.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/position.js"></script>
<script src="../../ui/menu.js"></script>
<script src="../../ui/selectmenu.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
var circle = $( "#circle" );
$( "#radius" ).selectmenu({
change: function( event, data ) {
circle.css({
width: data.item.value,
height: data.item.value
});
}
});
$( "#color" ).selectmenu({
change: function( event, data ) {
circle.css( "background", data.item.value );
}
});
});
</script>
<style>
fieldset {
border: 0;
margin-left: 300px;
}
label {
display: block;
margin: 20px 0 0 0;
}
select {
width: 200px;
}
#circle {
float: left;
background: yellow;
border-radius: 50%;
width: 150px;
height: 150px;
}
</style>
</head>
<body>
<div class="demo">
<form action="#">
<div id="circle"></div>
<fieldset>
<label for="radius">Circle radius</label>
<select name="radius" id="radius">
<option value="50">50px</option>
<option value="100">100px</option>
<option value="150" selected="selected">150px</option>
<option value="200">200px</option>
<option value="250">250px</option>
</select>
<label for="color">Circle color</label>
<select name="color" id="color">
<option value="black">Black</option>
<option value="red">Red</option>
<option value="yellow" selected="selected">Yellow</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
</fieldset>
</form>
</div>
<div class="demo-description">
<p>This Selectmenu Widget demo changes color and radius of a CSS circle. This demo is using the provided callback events.</p>
</div>
</body>
</html>
|