Photo test v7

This commit is contained in:
Arthur 2019-08-28 13:09:14 +02:00
parent 2cedb658a6
commit ecc57289a8
2 changed files with 17 additions and 33 deletions

View file

@ -663,11 +663,18 @@ Small Device Styles
} }
} }
#solution { .iframe-container {
font-size: 12px; overflow: hidden;
color: #535353; // Calculated from the aspect ration of the content (in case of 16:9 it is 9/16= 0.5625)
padding-top: 56.25%;
position: relative;
} }
#remarques {
font-size: 12px; .iframe-container iframe {
color: #535353; border: 0;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
} }

View file

@ -5,33 +5,10 @@ ob_start(); // Start reading html
-TEXTE- -TEXTE-
<br><br> <br><br>
<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSeQ6ldsTuBGNN5hnp7KP_tt2rRuvRREJMvohjwsOhXCVCnECw/viewform?embedded=true" id="ifrm" src="some-iframe-content.html">Chargement…</iframe> <div class="iframe-container">
<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSeQ6ldsTuBGNN5hnp7KP_tt2rRuvRREJMvohjwsOhXCVCnECw/viewform?embedded=true">Chargement…</iframe>
</div>
<script type="text/javascript">
function getDocHeight(doc) {
doc = doc || document;
// stackoverflow.com/questions/1145850/
var body = doc.body, html = doc.documentElement;
var height = Math.max( body.scrollHeight, body.offsetHeight,
html.clientHeight, html.scrollHeight, html.offsetHeight );
return height;
}
function setIframeHeight(id) {
var ifrm = document.getElementById(id);
var doc = ifrm.contentDocument? ifrm.contentDocument:
ifrm.contentWindow.document;
ifrm.style.visibility = 'hidden';
ifrm.style.height = "10px"; // reset to minimal height ...
// IE opt. for bing/msn needs a bit added or scrollbar appears
ifrm.style.height = getDocHeight( doc ) + 4 + "px";
ifrm.style.visibility = 'visible';
}
document.getElementById('ifrm').onload = function() { // Adjust the Id accordingly
setIframeHeight(this.id);
}
</script>
</body> </body>
<?php <?php
$pageContent = ob_get_clean(); // Store html content in variable $pageContent = ob_get_clean(); // Store html content in variable