4

我正在使用引导模式来显示图像。

我如何简单地使Twitter Bootstrap模态窗口更大?

我正在使用(相关)问题中的代码:

$('#myModal').modal({
        backdrop: true,
        keyboard: true,
        show: false
    }).css({
        // make width 90% of screen
       'width': function () { 
           return ($(document).width() * .9) + 'px';  
       },
        // center model
       'margin-left': function () { 
           return -($(this).width() / 2); 
       }
});

但结果如下:

我必须向下滚动它。如何保持图像比例并在没有滚动条的情况下显示它?

4

1 回答 1

4

当我们使用引导模式显示图像时,我们使用以下 css:

#myModal {
  max-height: 80%;
  overflow-y: auto;

  .modal-body {
    max-height: none;
    text-align: center;
  }
}

然后就做

$('#myModal').modal("show");

症结在于将max-heighton设置.modal-bodynone.

于 2013-06-18T08:12:17.020 回答