iframeiframe-resizer

documentElementScroll iframe resizer uses height from previous resize


i use davidjbradshaw/iframe-resizer to resize an iframe, everything is ok with CORS but i face a problem, when i resize the window from fullscreen the iframe height gets a different content height which is ok, but when i return back to fullscreen "heightCalculationMethod: 'documentElementScroll'", document content scrollheight uses the height of previous window which the content has bigger height and creates a space, that space is part of the iframe, eg. the iframe height is 900px, but the iframe content height is 800px, which is repsonsive and what i want!

Thanks in advance!

$('iframe').iFrameResize({
    autoResize: true,
    checkOrigin: false,
    heightCalculationMethod: 'documentElementScroll',
    sizeHeight: true,
    log: true
});

Solution

  • Changed iframe content's body height from 100% to auto and fixed it.