javascript - Resizing iFrames based on its contents' height only working to enlarge? -
take @ attached codepen see mean. try reducing width of browser, frame should correctly resize. maximize browser window , note frame doesn't re-adjust height.
i have multiple frames stacked ontop of each other quite annoying issue.
i've tried using .height(), .outerheight(), .innerheight(), .scrollheight , .clientheight no avail.
https://codepen.io/anon/pen/gxalpw
var newheight = $('#frame').contents().height(); $('#frame').attr('height', newheight);
thanks in advance any/all help!
try this
function resizeframe() { var newheight = $('#frame').contents().find("body").height(); $('#frame').attr('height', newheight + 20); }
Comments
Post a Comment