Hi Armin et al,
I’m having trouble figuring out how to dynamically resize an +HTML element to show the full content of an iFrame without scroll bars.
Searching the web, it seems that the only way to achieve this is by using Javascript. I’ve found a piece of code to do the job, but I’m unsure how to make it work correctly. I have no idea if the code will work with Laytheme or indeed if I have applied it correctly... any assistance you could give would be great appreciated.
Here’s the JS I have placed within the "Custom <head> content” section.
<script>
window.laytheme.on("newpageshown", function(){
var frame = document.getElementById("Iframe");
// Adjusting the iframe height onload event
frame.onload = function() {
// set the height of the iframe as the height of the iframe content
frame.style.height = frame.contentWindow.document.body.scrollHeight + 'px';
}
});
</script>
And here’s a link to the test page: https://zmr.eab.myftpupload.com/latest-jobs/
Again, any assistance you can give would be greatly appreciated.
Best wishes, D.