Skip to content
Snippets Groups Projects
Commit c60e117d authored by Ken Hawkins's avatar Ken Hawkins
Browse files

Dynamically set iframe height

parent b4596988
No related branches found
No related tags found
No related merge requests found
......@@ -143,3 +143,8 @@ $("#main-content-area h2, #main-content-area h3").each(function() {
output +="</ul></nav>";
$(".table-of-contents").html(output);
// Set iframe height for patterns
if ($('#building-block-iframe').length > 0) {
$('#building-block-iframe').css('min-height',document.getElementById('building-block-iframe').contentWindow.document.body.scrollHeight+'px')
}
<div class="building-block-preview">
<div class="row align-center expanded building-block-iframe-wrapper ">
<iframe class="building-block-iframe" src="{{bb-iframe-path page}}" frameborder="0"></iframe>
<iframe class="building-block-iframe" src="{{bb-iframe-path page}}" frameborder="0" id="building-block-iframe"></iframe>
</div>
</div>
<hr/>
.building-block-iframe {
position: absolute; /* To fix iframe's hight in Edge */
left: 0;
top: 0;
// position: absolute; /* To fix iframe's hight in Edge */
// left: 0;
// top: 0;
display: block;
width: 100%;
min-height: 100%; /* To fix iframe's hight in Edge */
// min-height: 100%; /* To fix iframe's hight in Edge */
min-height: 500px;
}
.building-block-iframe-wrapper {
position: relative; /* To fix iframe's hight in Edge */
min-height: 480px;
/* To fix iframe scrolling on ios */
-webkit-overflow-scrolling: touch;
overflow: hidden;
}
// .building-block-iframe-wrapper {
// position: relative; /* To fix iframe's hight in Edge */
// min-height: 480px;
//
// /* To fix iframe scrolling on ios */
// -webkit-overflow-scrolling: touch;
// overflow: hidden;
// }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment