1
我想使用srcdoc中的html來調整iframe的高度,我選擇使用iframe-resizer庫。 但iframe不會調整大小,回調也不會調用。iframe-resizer not resize iframe with srcdoc html
HTML:
<iframe scrolling="no" class="preview-iframe" id="iframe3" srcdoc="<html><head></head><body><p>TEST</p>
</body></html>"></iframe>
JS:
$('iframe#iframe3').iFrameResize({
heightCalculationMethod: 'bodyScroll',
log: true,
resizedCallback: function() {
console.log('resize');
},
initCallback: function() {
console.log('init');
},
});
你的示例代碼,包括你的小提琴,真的被愚弄了。目前還不清楚你有什麼問題。 –
我想我的iframe的高度適應它的內容,在我的小提琴它應該適應高度'測試'paragrah – Drakkin