Home  >  Article  >  Web Front-end  >  Let iframe web pages automatically scale in any browser_javascript skills

Let iframe web pages automatically scale in any browser_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:27:04781browse

The method is as follows, save the 2-section
code as prompted.
Please save as mainframe.htm

Copy code The code is as follows:








Please Save as frame.htm
Copy code The code is as follows:






Hu Dongping Online space


sfsfere






Execute mainframe.htm to see the effect.
When applying modifications, pay attention to the ID of the table defined in mainframe.htm and frame.htm, and then remember to modify the corresponding
calling file name and path in the frame statement, and pay attention to the following sentence:
Copy code The code is as follows:

onload="style.width=this.contentWindow.document.all. formfra.offsetWidth;"
"style.height=this.contentWindow.document.all.formfra.offsetHeight"

Make corresponding modifications
Copy code The code is as follows:

this.contentWindow.document.all. Call page form ID.offsetWidth
this.contentWindow.document.all. Call page table ID.offsetHeight

Remember, the table ID must be defined.​
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