Visualizzazione dei risultati da 1 a 9 su 9

Visualizzazione discussione

  1. #1

    Iframe adattato ai differenti contenuti

    In una pagina html ho inserito uno script che dovrebbe adattarsi in altezza ai differenti contenuti linkati. Purtroppo non funziona e non capisco dove sbaglio...

    codice:
     
    <script language="JavaScript">
    
    <!--
    function autoResize(external-frame){
        var newheight;
        var newwidth;
    
        if(document.getElementById){
            newheight=document.getElementById(external-frame).contentWindow.document .body.scrollHeight;
            newwidth=document.getElementById(external-frame).contentWindow.document .body.scrollWidth;
        }
    
        document.getElementById(external-frame).height= (newheight) + "px";
        document.getElementById(external-frame).width= (newwidth) + "px";
    }
    //-->
    </script>
    e l'iframe settato come segue:
    codice:
    <div id="Layer3">
    <iframe src="index.php" scrolling="no" width="100%" height="100%" name="external-frame" id="external-frame" marginheight="0" frameborder="0" onLoad="autoResize('external-frame');"></iframe>
    </div>
    Ultima modifica di Vincent.Zeno; 29-10-2015 a 17:41

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.