-1

Help me find a solution for the responsive iframe window. For example: if the size content of the window iframe changes, iframe resize automatically in parent window.

Note: in iframe window dynamically content.

Falselight
  • 445
  • 5
  • 8
  • Possible duplicate of [Resizing an iframe based on content](https://stackoverflow.com/questions/153152/resizing-an-iframe-based-on-content) – Daniel Beck Sep 05 '18 at 18:53
  • My situation another. Inside frame have javascript which generates content. And I find solution, I need: detected height change. – Falselight Sep 05 '18 at 20:58

1 Answers1

0

I found a solution from Avi:

// HTML

<div class="myIframe"> 
   <iframe> </iframe> 
</div>

// CSS

.myIframe {
     position: relative;
     padding-bottom: 65.25%;
     padding-top: 30px;
     height: 0;
     overflow: auto; 
     -webkit-overflow-scrolling:touch; //<<--- THIS IS THE KEY 
     border: solid black 1px;
} 
.myIframe iframe {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
}