I have a custom sized (80% height width) bootstrap modal body and it scrolls (body content will overflow on some sized screens)
There are 2 problems:
Pwnna's answer have good concept, bud doesn't work for me. Here is solution that work's for me:
fit_modal_body = function (modal, padding) {
var windowHeight = $(window).height();
var modalHeight = modal.height();
var dif = windowHeight - (modalHeight + 2*padding);
var modalBody = $(".modal-body:first", modal);
modalBody.css("max-height", modalBody.height() + dif);
};
resizeLastWindow = function () {
fit_modal_body($(".modal-dialog:last"), 15);
};
$(window).resize(resizeLastWindow);
It's depend's on css:
.modal-body {
overflow-y: auto;
}