通過@Bass Jobsen
尼斯回答不過我覺得有時候我們可能需要動態調整模式。所以在這裏擴展低音的解決方案,調整大小,拖動模式
加成
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css" />
和
$('.modal-content').resizable();
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css" />
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<div>
<div class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<script>
$('.modal').modal({ keyboard: false,
show: true
});
// Jquery draggable
$('.modal-dialog').draggable({
handle: ".modal-header"
});
$('.modal-content').resizable();
</script>
此外,你可以指定了minHeight和M inWidth
$('.modal-content').resizable({
minHeight: 100,
minWidth: 100
});
讓你的問題的小提琴 – Innodel 2014-11-25 07:22:03