iframe이 있고 실제 콘텐츠를 기반으로 크기를 조정하려고합니다 (예 : 스크롤하지 않도록). 나는 다음을 시도했다 :Firefox : 실제 콘텐츠에 따라 iframe의 크기를 조절하십시오.
alert (document.getElementById (iframe) .content); 경고 (document.getElementById (iframe) .contentWindow.document.body.scrollHeight); alert (document.getElementById (iframe) .contentWindow.document.body.offsetHeight);
해당 작업 없음. iframe에는 iframe의 ID가 들어 있습니다. 마지막 두 줄은 Chrome에서 작동합니다.
도움이 될 것입니다.
두 도메인이 같은 도메인에 있습니까? – tomsv
Yeap - same one – Yannis
이 질문은 중복 되었습니까? http://stackoverflow.com/questions/11806947/is-it-possible-that-iframe-resize-itself-without-help-from-main-window – Juffy