|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>jQuery UI Selectmenu - Default functionality</title> |
| 6 | + <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"> |
| 7 | + <script src="../../jquery-1.10.2.js"></script> |
| 8 | + <script src="../../ui/jquery.ui.core.js"></script> |
| 9 | + <script src="../../ui/jquery.ui.widget.js"></script> |
| 10 | + <script src="../../ui/jquery.ui.position.js"></script> |
| 11 | + <script src="../../ui/jquery.ui.menu.js"></script> |
| 12 | + <script src="../../ui/jquery.ui.selectmenu.js"></script> |
| 13 | + <link rel="stylesheet" href="../demos.css"> |
| 14 | + <script> |
| 15 | + $(function() { |
| 16 | + $( "#width-auto, #width-auto2" ).selectmenu(); |
| 17 | + |
| 18 | + $( "#width-css, #width-css2" ).selectmenu(); |
| 19 | + |
| 20 | + $( "#width-js, #width-js2" ).selectmenu({ |
| 21 | + width: 200 |
| 22 | + }); |
| 23 | + |
| 24 | + var fixedMenuWidth = $( "#width-cssmenu" ).selectmenu(), |
| 25 | + fixedMenuWidth2 = $( "#width-cssmenu2" ).selectmenu(); |
| 26 | + |
| 27 | + fixedMenuWidth.selectmenu( "menuWidget" ).addClass( "fixed-menu-width" ); |
| 28 | + fixedMenuWidth2.selectmenu( "menuWidget" ).addClass( "fixed-menu-width" ); |
| 29 | + }); |
| 30 | + </script> |
| 31 | + <style> |
| 32 | + fieldset { |
| 33 | + border: 0; |
| 34 | + } |
| 35 | + label { |
| 36 | + display: block; |
| 37 | + margin: 30px 0 0 0; |
| 38 | + } |
| 39 | + |
| 40 | + #width-css, |
| 41 | + #width-css2, |
| 42 | + #width-cssmenu, |
| 43 | + #width-cssmenu2 { |
| 44 | + width: 200px; |
| 45 | + } |
| 46 | + |
| 47 | + .fixed-menu-width { |
| 48 | + width: 400px; |
| 49 | + } |
| 50 | + </style> |
| 51 | +</head> |
| 52 | +<body> |
| 53 | + |
| 54 | +<div class="demo"> |
| 55 | + |
| 56 | +<form action="#"> |
| 57 | + |
| 58 | + <fieldset> |
| 59 | + <label for="width-auto">Auto width</label> |
| 60 | + <select name="width-auto" id="width-auto"> |
| 61 | + <option value="jquery">jQuery.js</option> |
| 62 | + <option value="jqueryui">ui.jQuery.js</option> |
| 63 | + <option value="somefile">Some unknown file</option> |
| 64 | + <option value="someotherfile">Some other file with a very long option text</option> |
| 65 | + </select> |
| 66 | + <label for="width-auto2">Auto width (no long option)</label> |
| 67 | + <select name="width-auto2" id="width-auto2"> |
| 68 | + <option value="jquery">jQuery.js</option> |
| 69 | + <option value="jqueryui">ui.jQuery.js</option> |
| 70 | + <option value="somefile">Some unknown file</option> |
| 71 | + <option value="someotherfile">Some other file</option> |
| 72 | + </select> |
| 73 | + |
| 74 | + <label for="width-css">CSS width</label> |
| 75 | + <select name="width-css" id="width-css"> |
| 76 | + <option value="jquery">jQuery.js</option> |
| 77 | + <option value="jqueryui">ui.jQuery.js</option> |
| 78 | + <option value="somefile">Some unknown file</option> |
| 79 | + <option value="someotherfile">Some other file with a very long option text</option> |
| 80 | + </select> |
| 81 | + |
| 82 | + <label for="width-css2">CSS width (no long option)</label> |
| 83 | + <select name="width-css2" id="width-css2"> |
| 84 | + <option value="jquery">jQuery.js</option> |
| 85 | + <option value="jqueryui">ui.jQuery.js</option> |
| 86 | + <option value="somefile">Some unknown file</option> |
| 87 | + <option value="someotherfile">Some other file</option> |
| 88 | + </select> |
| 89 | + |
| 90 | + <label for="width-js">JS width</label> |
| 91 | + <select name="width-js" id="width-js"> |
| 92 | + <option value="jquery">jQuery.js</option> |
| 93 | + <option value="jqueryui">ui.jQuery.js</option> |
| 94 | + <option value="somefile">Some unknown file</option> |
| 95 | + <option value="someotherfile">Some other file with a very long option text</option> |
| 96 | + </select> |
| 97 | + <label for="width-js2">JS width (no long option)</label> |
| 98 | + <select name="width-js2" id="width-js2"> |
| 99 | + <option value="jquery">jQuery.js</option> |
| 100 | + <option value="jqueryui">ui.jQuery.js</option> |
| 101 | + <option value="somefile">Some unknown file</option> |
| 102 | + <option value="someotherfile">Some other file</option> |
| 103 | + </select> |
| 104 | + |
| 105 | + <label for="width-cssmenu">CSS width for button and menu</label> |
| 106 | + <select name="width-cssmenu" id="width-cssmenu"> |
| 107 | + <option value="jquery">jQuery.js</option> |
| 108 | + <option value="jqueryui">ui.jQuery.js</option> |
| 109 | + <option value="somefile">Some unknown file</option> |
| 110 | + <option value="someotherfile">Some other file with a very long option text</option> |
| 111 | + </select> |
| 112 | + <label for="width-cssmenu2">CSS width for button and menu (no long option)</label> |
| 113 | + <select name="width-cssmenu2" id="width-cssmenu2"> |
| 114 | + <option value="jquery">jQuery.js</option> |
| 115 | + <option value="jqueryui">ui.jQuery.js</option> |
| 116 | + <option value="somefile">Some unknown file</option> |
| 117 | + <option value="someotherfile">Some other file</option> |
| 118 | + </select> |
| 119 | + </fieldset> |
| 120 | + |
| 121 | +</form> |
| 122 | + |
| 123 | +</div> |
| 124 | + |
| 125 | +<div class="demo-description"> |
| 126 | +<p>Width option demo. Take a look at the source code to see how the width is set.</p> |
| 127 | +</div> |
| 128 | +</body> |
| 129 | +</html> |
0 commit comments