WebSite X5Help Center

 
Mohamed F.
Mohamed F.
User

IFrame height responsive  en

Autore: Mohamed F.
Visite 1751, Followers 1, Condiviso 0  

Hi,
I need to make the height of the Iframe responsive according to the user screen resolution, as the width alraedy works automatecly but the height keep fixed so on small screens I got a large empty space between this cell and the bellow one.

This is the link of my project:
https://www.egytouch.com/demo2/

This is the link that I call in my Iframe:

https://www.egytouch.com/demo2/slider/move.html

Thanks in advance.

Postato il
2 RISPOSTE - 1 CORRETTO
Incomedia
Stefano G.
Incomedia

Hi Mohamed

I can confirm that at the moment, there is no such default option inside the software to configure the iFrame to be as tall as the whole page and you would mandatorily need to rely on custom code to achieve such result

Unfortunately, the Staff cannot provide support for this custom code, but I will leave the topic open anyway so that other users might eventually stop by and help you out with this

I apologize for not being able to help further, but let me know here if I can be of help for something else

Thank you

Stefano

Leggi di più
Postato il da Stefano G.
 ‪ KolAsim ‪ ‪
 ‪ KolAsim ‪ ‪
Moderator

(It > En) ... you can freely use an extra original code of my exclusive invention, to be pasted into the custom code expert panel, before closing the tag / HEAD, or in the same object HTML code of the IFRAME:

... code IFRAME:

<iframe id="iframeK" src="https://www.egytouch.com/demo2/slider/move.html" frameborder="0" style="position:absolute;top:0px;left:0px; width:100%;height:873px"></iframe>

... code JS:

<!-- =========== K ========== -->
<script>function h_rowK(){
var ww =1920; // larghezza finestra;
var hh =843; // altezza finestra;
var wrowk = document.getElementById('imPage').offsetWidth;
var hiframe=Math.round(wrowk*hh/ww);
document.getElementById('imHTMLObject_26').style.height=hiframe + "px";
document.getElementById('iframeK').style.height=hiframe + "px";}
window.onload = function () {h_rowK();}
window.onresize = function () {h_rowK();} </script>
<!-- =========== K ========== -->

.

ciao

.

Leggi di più
Postato il da  ‪ KolAsim ‪ ‪