Home >Web Front-end >JS Tutorial >How to implement adaptive height of iframe (embedded frame)_javascript skills
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