F
F
Fredd Monty2016-12-19 20:07:58
JavaScript
Fredd Monty, 2016-12-19 20:07:58

How to put iframe full height on page without scrolling?

Hello!
How to put iframe full height on page without scrolling?
What would the iframe be as tall as the content.
Well, scrolled on the general page.

Give me an example.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GreatBOND, 2016-12-19
@GreatBOND

Maybe I'm wrong (I don't know if it will work with <iframe>, I haven't tried it). But such units as vh appeared in CSS
https://habrahabr.ru/post/126863/ , although I saw an article somewhere newer ....

I
Ivan, 2016-12-23
@usyninis

I implemented this through Window.postMessage()
The site inside the frame reads its height using js and passes it to postMessage.
The site where the frame is embedded listens to the message and changes the height of the frame to the received value.
One feature: if the height of the site inside the frame can change, then for each change in height, you need to add a transfer of a new height value

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question