How to automatically resize an iframe based on browser window width and document length?
I need to create a frameborder=0
iframe with no scroll bars.
It needs to automatically resize its width based on the browser window's current width.
Its height needs to be based开发者_运维知识库 on the document.length
. So if it's a long page, the iframe needs to stretch way down.
This way, there is no scrollbar created in the iframe.
var myIframe = $(document.frames['idIframe']);
$(document).bind('resize', function() {
myIframe.attr("width", $(this).width());
myIframe.attr("height", $(this).height());
});
This question here may have the answer you are looking for...
精彩评论