Home  >  Article  >  Web Front-end  >  js controls the height/width of iframe so that it adapts to the content

js controls the height/width of iframe so that it adapts to the content

高洛峰
高洛峰Original
2017-01-09 09:16:411504browse

<mce:script language= "Javascript "><!-- 

window.onload=function() 
{ 
parent.document.all("iframe1").style.height = document.body.scrollHeight; 
parent.document.all("iframe1").style.width = document.body.scrollWidth; 
} 
// --></mce:script>


For more js control of the height/width of the iframe so that it can adapt to the content, please pay attention to the PHP Chinese website!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn