diehuacanmeng

$(\'#modal\').on(\'show.bs.modal\', function(){
    var $this = $(this);
    var $modal_dialog = $this.find(\'.modal-dialog\');
    $this.css(\'display\', \'block\');//如没将modal设置为 block,则$modala_dialog.height() 为零
    $modal_dialog.css({\'margin-top\': Math.max(0, ($(window).height() - $modal_dialog.height()) / 2) });
});

  

  

分类:

技术点:

相关文章: