我有这个HTML
<div id="create" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
</div>
<div class="modal-body">
<select class="form-control select" name="list" id="list"
placeholder="SelectList" required>
<option value="">Select List</option>
<option value="">one</option>
<option value="two">two</option>
<option value="three">three</option>
</select>
</div>
$(document).ready(function(){
$.fn.modal.Constructor.prototype.enforceFocus = function() {};
$('.select').select2({
dropdownParent: $('#create')
});
}):
我尝试在堆栈溢出中寻找答案他们确实有一些答案,因为我已经实现了上面但它似乎没有工作
答案 0 :(得分:0)
<i>
<style type="text/css">
.modal-open .select2-container--open { z-index: 999999 !important; width:100% !important; }
</style>
</i>
为我工作