


The problem is, the div is going down maybe about a third of the way, and then cutting off and forcing me to scroll through the individual iframe to see the rest of the data, NOT stretching the entire length to display the entire iframe like I want it to. iframe-resizer-react This library is the official React interface for iframe-resizer, which enables the automatic resizing of the height and width of both same and cross domain iFrames to fit their contained content. I’m calling it to display via an iframe tag in my HTML code, and I’m placing that iframe tag inside of a div called roster.īecause the height of the roster is changing constantly as it gets updated each day, the height of the div the iframe is contained in needs to automatically adjust to whatever the height of the iframe happens to be. The reason why this feature exist is that elements which are hidden with the css style display:none do return 0 as height when measured with Javascript on. I have a roster for a class that is being updated constantly on an external source.
#Iframe height auto update
Then, in the parent window, we can set a simple script to dynamically update the height of the iframe. That way, we can send a height value from the iframe to the parent window. The height attribute specifies the height of an iframe. I have a very simple problem that’s giving me a very complex headache! Using the window.postMessage() method, we can safely communicate between the iframe and the parent window. I am trying to make the height set to auto so that the frame auto resizes to the page length without having to hardcode the height as I am doing here. The height property sets or returns the value of the height attribute in an iframe element.
