selectmenu的open
方法不起作用。
$( "#speed" ).selectmenu('open'); // doesn't work
想法?
HTML
<button id="btn">open it</button>
<fieldset>
<label for="speed">Select a speed</label>
<select name="speed" id="speed">
<option value="Slower">Slower</option>
<option value="Slow">Slow</option>
<option value="Medium" selected="selected">Medium</option>
<option value="Fast">Fast</option>
<option value="Faster">Faster</option>
</select>
</fieldset>
JS
$(function () {
$( "#speed" ).selectmenu();
$('#btn').click(function(){
$( "#speed" ).selectmenu('open'); // doesn't work
});
});
CSS
fieldset {
border: 0;
}
label {
display: block;
margin: 30px 0 0 0;
}
select {
width: 200px;
}
.overflow {
height: 200px;
}