Home >Web Front-end >JS Tutorial >How to implement adaptive height of iframe (embedded frame)_javascript skills

How to implement adaptive height of iframe (embedded frame)_javascript skills

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

Several times I saw someone asking how to implement the adaptive height of iframe, which can automatically adapt with the length of the page to avoid the phenomenon of scroll bars appearing on the page and iframe at the same time. I happened to encounter a similar problem at work, so I went online. After searching and copying here and there, I came up with such a function, which can be used after pasting it into the page. I dare not keep it exclusive, if you find it useful, you are welcome to use

The source code is as follows

Copy the code The code is as follows:




When using it, just paste it in
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