I have been fighting with iFrame height couple hours now and got just bad headache. Having three different iFrames in my site. They popping up when you click the button. One iFrame can be displayed at once.
Have been trying different JS scripts and CSS tricks i have found on internet, none of them working.
HTML
<div id="frontpage-7-div" class="d-flex align-items-center justify-content-center row">
<div class="btn-group btn-group-toggle" style="padding: 20px; height: 100px;" data-toggle="buttons">
<label class="btn btn-secondary active" onclick="Leppavaara()">
<input type="radio" autocomplete="off"> Espoo
</label>
<label class="btn btn-secondary" onclick="Tivolitie()">
<input type="radio" autocomplete="off"> Alppila
</label>
<label class="btn btn-secondary" onclick="Helsinki()">
<input type="radio" autocomplete="off"> Lauttasaari
</label>
</div>
<div id="leppavaara" class="kalenteri">
<iframe width="100%" frameborder="0" scrolling="no" src="https://varaa.timma.fi/reservation/susannasnailsalonleppavaara" id="reservationIframe"></iframe>
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/2.8.3/iframeResizer.min.js"></script>
<script type="text/javascript">iFrameResize({checkOrigin: false}, '#reservationIframe8112');</script>
</div>
<div id="helsinki" class="kalenteri">
<iframe width="100%" frameborder="0" scrolling="no" src="https://varaa.timma.fi/reservation/susannasnailssalonlauttasaari" id="reservationIframe"></iframe>
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/2.8.3/iframeResizer.min.js"></script>
<script type="text/javascript">iFrameResize({checkOrigin: false}, '#reservationIframe8112');</script>
</div>
<div id="tivolitie" class="kalenteri">
<iframe width="100%" frameborder="0" scrolling="no" src="https://varaa.timma.fi/reservation/susannasnailsalonhelsinki" id="reservationIframe"></iframe>
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/2.8.3/iframeResizer.min.js"></script>
<script type="text/javascript">iFrameResize({checkOrigin: false}, '#reservationIframe8112');</script>
</div>
</div>
CSS
#leppavaara {
display: inline;
}
#helsinki {
display: none;
}
#tivolitie {
display: none;
}
.kalenteri {
width: 100%;
height: auto;
}
Tried example these:
https://css-tricks.com/snippets/jquery/fit-iframe-to-content/
HTML5 iFrame is only 150px in height
I am stuck at 150px, i can set manually height for example 700px, but those iframes are different height. And the height changes in mobile also. So that is why i want use its own height.
Question is: How can I set height same as the iframe content is?