|
107 | 107 | }); |
108 | 108 |
|
109 | 109 | /* empty */ |
110 | | - $('.empty select').selectmenu(); |
| 110 | + $(".empty select").selectmenu(); |
| 111 | + |
| 112 | + /* width */ |
| 113 | + $("#width_auto1, #width_auto2").selectmenu(); |
| 114 | + |
| 115 | + $("#width_js1, #width_js2").selectmenu({ |
| 116 | + width: 200 |
| 117 | + }); |
| 118 | + |
| 119 | + var widthMenu = $("#width_menu").selectmenu(); |
| 120 | + widthMenu.selectmenu("menuWidget").addClass("width-menu"); |
| 121 | + |
111 | 122 | }); |
112 | 123 | </script> |
113 | 124 | <style> |
|
117 | 128 | select { width: 200px; } |
118 | 129 |
|
119 | 130 | .ui-selectmenu-button { display: block; margin-bottom: 1em;} |
| 131 | + |
| 132 | + /* width */ |
| 133 | + .width-menu { width: 196px; } |
120 | 134 | </style> |
121 | 135 | </head> |
122 | 136 | <body> |
@@ -237,6 +251,44 @@ <h2>Empty tests</h2> |
237 | 251 | </optgroup> |
238 | 252 | </select> |
239 | 253 | </fieldset> |
| 254 | + |
| 255 | + <h2>Width tests</h2> |
| 256 | + <fieldset> |
| 257 | + <label for="width_auto1">Width auto</label> |
| 258 | + <select name="width_auto1" id="width_auto1" style="width: auto;"> |
| 259 | + <option>Width test 1</option> |
| 260 | + <option>Width test 2</option> |
| 261 | + <option>Width test 3</option> |
| 262 | + </select> |
| 263 | + |
| 264 | + <label for="width_auto2">Width auto with long option</label> |
| 265 | + <select name="width_auto2" id="width_auto2" style="width: auto;"> |
| 266 | + <option>Width test 1</option> |
| 267 | + <option>Width test 2</option> |
| 268 | + <option>Width test 3 Width test 3 Width test 3</option> |
| 269 | + </select> |
| 270 | + |
| 271 | + <label for="width_js1">Width set by JS</label> |
| 272 | + <select name="width_js1" id="width_js1"> |
| 273 | + <option>Width test 1</option> |
| 274 | + <option>Width test 2</option> |
| 275 | + <option>Width test 3</option> |
| 276 | + </select> |
| 277 | + |
| 278 | + <label for="width_js2">Width set by JS with long option</label> |
| 279 | + <select name="width_js2" id="width_js2"> |
| 280 | + <option>Width test 1</option> |
| 281 | + <option>Width test 2</option> |
| 282 | + <option>Width test 3 Width test 3 Width test 3</option> |
| 283 | + </select> |
| 284 | + |
| 285 | + <label for="width_menu">Width set by JS with long option</label> |
| 286 | + <select name="width_menu" id="width_menu"> |
| 287 | + <option>Width test 1</option> |
| 288 | + <option>Width test 2</option> |
| 289 | + <option>Width test 3 Width test 3 Width test 3</option> |
| 290 | + </select> |
| 291 | + </fieldset> |
240 | 292 | </form> |
241 | 293 |
|
242 | 294 | <div style="position: absolute; top: 1em; right: 1em;"> |
|
0 commit comments