(1)修改寬度可以通過修改modal中的modal-dialog這個div寬度實現
- <div class="modal-dialog" style="width:600px">
(2) 修改高度和寬度最好的辦法是修改modal-body中新增的控制元件,設定控制元件的大小,modal會自動適應。
例如
- <div class="modal fade in" id="_modalDialog" tabindex="-1" role="dialog" aria-labelledby="modalLabel"
- style="display: block;">
- <div class="modal-dialog" role="document" style="width: 680px;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
- </button>
- <h4 class="modal-title" id="modalLabel">選擇移動到的目錄</h4></div>
- <div id="_modalDialog_body" class="modal-body">
- <!-- 設定這個div的大小,超出部分顯示滾動條 -->
- <div id="selectTree" class="ztree" style="height:300px;overflow:auto; ">
- </div>
- </div>
- <div class="modal-footer">
- <button type="submit" class="btn btn-primary">確定</button>
- <button type="button" class="btn btn-default" data-dismiss="modal">關閉</button>
- </div>
- </div>
- </div>
- </div>
顯示效果圖