Reputation: 890
I am trying to use selectmenu it just doesn't work. When I click on selected option selectmenu doesn't hide. Also it is screen wide even though I set width to 200px. Here is my code. What is wrong?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/smoothness/jquery-ui.css" type="text/css">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.3/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#speed").selectmenu();
});
</script>
</head>
<body>
<label for="speed">Choose</label>
<select name="speed" id="speed" style="width: 200px">
<option>Slower</option>
<option>Slow</option>
<option selected="selected">Medium</option>
<option>Fast</option>
<option>Faster</option>
</select>
</body>
</html>
Upvotes: 1
Views: 775
Reputation: 73
You can't use selectmenu() with this version of css, because the css classes are not defined yet in it.
If you use the version of the example (1.11.4) it works correctly.
Upvotes: 1