<分区>
我需要根据 iframe
内容的高度调整此 bootstrap
模态的大小,因为它是动态的。
使用 onload
和以下函数我什么也没得到。
window.resizeIframe = function () {
var frame = $('#custom-frame');
var modalHeight = $('#custom-frame').contents().height();
frame.height(modalHeight);
$(window).resize(function() {
frame.height(modalHeight);
});
};
我提供了一个 plunker: http://plnkr.co/edit/eElqXJwvxmpc1XMrdwIK?p=preview