不需要去Bootstrap v3.3.7.js里面去找代码(小眼睛都看成大眼睛了),你只要在你使用Bootstrap模态框的那个页面的js里面加上下面的代码,就可以了(什么都不用改,直接粘贴就可用了)
$(document).on(‘show.bs.modal’,’.modal’,function(e){
var $this= $(this);`
var $modal_dialog = $this.find('.modal-dialog');
$this.css('display', 'block');
$modal_dialog.css({'margin-top': Math.max(0, ($(window).height() - $modal_dialog.height()) / 2) });
});