1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < meta http-equiv ="content-type " content ="text/html; charset=utf-8 " />
5
+ < title > Demo Page for jQuery UI selectmenu</ title >
6
+
7
+ < link type ="text/css " href ="../../themes/base/jquery.ui.all.css " rel ="stylesheet " />
8
+ < link type ="text/css " href ="../../themes/base/jquery.ui.selectmenu.css " rel ="stylesheet " />
9
+ < script type ="text/javascript " src ="../../jquery-1.4.4.js "> </ script >
10
+ < script type ="text/javascript " src ="../../ui/jquery.ui.core.js "> </ script >
11
+ < script type ="text/javascript " src ="../../ui/jquery.ui.widget.js "> </ script >
12
+ < script type ="text/javascript " src ="../../ui/jquery.ui.position.js "> </ script >
13
+
14
+ < script type ="text/javascript " src ="../../ui/jquery.ui.selectmenu.js "> </ script >
15
+
16
+ < style type ="text/css ">
17
+ /* demo styles */
18
+ body {font-size : 62.5% ; font-family : "Verdana" , sans-serif; }
19
+ fieldset { border : 0 ; }
20
+ label , select , .ui-select-menu { float : left; margin-right : 10px ; }
21
+ select { width : 200px ; }
22
+ </ style >
23
+ < script type ="text/javascript ">
24
+ $ ( function ( ) {
25
+ $ ( 'select#switch' ) . selectmenu ( {
26
+ style :'popup' ,
27
+ // use seleect callback
28
+ select : function ( event , options ) {
29
+ if ( options . value == 1 ) {
30
+ $ ( 'select#ghost' ) . parent ( "fieldset" ) . show ( ) ;
31
+ } else {
32
+ $ ( 'select#ghost' ) . parent ( "fieldset" ) . hide ( ) ;
33
+ }
34
+ }
35
+ } ) ;
36
+
37
+ var ghost = $ ( 'select#ghost' ) . selectmenu ( {
38
+ maxHeight : 150
39
+ } ) . parent ( "fieldset" ) . hide ( ) ;
40
+ } ) ;
41
+ </ script >
42
+ </ head >
43
+ < body >
44
+ < br />
45
+ < br />
46
+ < form action ="# ">
47
+
48
+ < fieldset >
49
+ < label for ="switch "> Select a Speed:</ label >
50
+ < select name ="switch " id ="switch ">
51
+ < option value ="1 "> shown</ option >
52
+ < option value ="0 " selected ="selected "> hidden</ option >
53
+ </ select >
54
+ </ fieldset >
55
+
56
+ < fieldset >
57
+ < label for ="ghost "> Hiding in the dark</ label >
58
+ < select name ="ghost " id ="ghost ">
59
+ < option value ="Slower "> -6 Slower</ option >
60
+ < option value ="Slower "> -5 Slower</ option >
61
+ < option value ="Slower "> -4 Slower</ option >
62
+ < option value ="Slow "> -3 Slow</ option >
63
+ < option value ="Slow "> -2 Slow</ option >
64
+ < option value ="Slow "> -1 Slow</ option >
65
+ < option value ="Medium " selected ="selected "> 0 Medium</ option >
66
+ < option value ="Fast "> 1 Fast</ option >
67
+ < option value ="Fast "> 2 Fast</ option >
68
+ < option value ="Fast "> 3 Fast</ option >
69
+ < option value ="Faster "> 4 Faster</ option >
70
+ < option value ="Faster "> 5 Faster</ option >
71
+ < option value ="Faster "> 6 Faster</ option >
72
+ </ select >
73
+ </ fieldset >
74
+ </ form >
75
+ </ body >
76
+ </ html >
0 commit comments