Skip to content

Instantly share code, notes, and snippets.

@wok
Last active December 14, 2015 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wok/5040447 to your computer and use it in GitHub Desktop.
Save wok/5040447 to your computer and use it in GitHub Desktop.
select2 - jQuery UI 1.10
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<script src="select2.js"></script>
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css"/>
<link rel="stylesheet" type="text/css" href="select2.css"/>
<style type="text/css">
select { width: 300px; }
</style>
<script type="text/javascript">
$(document).ready( function() {
$("#dialog").dialog({
modal: true
});
// does not work:
$("select").select2();
// works:
//$("select").select2( { dropdownCssClass: 'ui-dialog' } );
});
</script>
</head>
<body>
<div id="dialog">
<select>
<option value="one">One</option>
<option value="two">Two</option>
<option value="three">Three</option>
<option value="four">Four</option>
</select>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment