Debian Codegraph @

demos/selectmenu/product-selection.html

raw
1 <!doctype html>
2 <html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>jQuery UI Selectmenu - Product Selection</title>
7 <link rel="stylesheet" href="../../themes/base/all.css">
8 <link rel="stylesheet" href="../demos.css">
9 <style>
10 fieldset {
11 border: 0;
12 margin-left: 300px;
13 }
14 label {
15 display: block;
16 margin: 20px 0 0 0;
17 }
18
19 #circle {
20 float: left;
21 background: yellow;
22 border-radius: 50%;
23 width: 150px;
24 height: 150px;
25 }
26 </style>
27 <script src="../../external/requirejs/require.js"></script>
28 <script src="../bootstrap.js">
29 var circle = $( "#circle" );
30
31 $( "#radius" ).selectmenu({
32 change: function( event, data ) {
33 circle.css({
34 width: data.item.value,
35 height: data.item.value
36 });
37 }
38 });
39
40 $( "#color" ).selectmenu({
41 change: function( event, data ) {
42 circle.css( "background", data.item.value );
43 }
44 });
45 </script>
46 </head>
47 <body>
48
49 <div class="demo">
50
51 <form action="#">
52
53 <div id="circle"></div>
54
55 <fieldset>
56 <label for="radius">Circle radius</label>
57 <select name="radius" id="radius">
58 <option value="50">50px</option>
59 <option value="100">100px</option>
60 <option value="150" selected="selected">150px</option>
61 <option value="200">200px</option>
62 <option value="250">250px</option>
63 </select>
64
65 <label for="color">Circle color</label>
66 <select name="color" id="color">
67 <option value="black">Black</option>
68 <option value="red">Red</option>
69 <option value="yellow" selected="selected">Yellow</option>
70 <option value="blue">Blue</option>
71 <option value="green">Green</option>
72 </select>
73 </fieldset>
74
75 </form>
76
77 </div>
78
79 <div class="demo-description">
80 <p>This Selectmenu Widget demo changes color and radius of a CSS circle. This demo is using the provided callback events.</p>
81 </div>
82 </body>
83 </html>