Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Apr 2003
    Messaggi
    73

    iframe auto size o modulo con link esterno

    salve ho un sito in phpnuke e un secondo sito che vorrei integrare come modulo del primo una sorta di iframe .

    esempio

    imaginate di avere n moduli ,
    http://sito/modules.php?name=Downloads
    http://sito/modules.php?name=news

    solo che uno di questi moduli
    http://sito/modules.php?name=????? in realta non è sotto la directory modules ma è un altro sito

    http://sito2/index.php

    come faccio ad integrarlo come se fosse un modulo? facendo visualizzare il menu di sinistra quello in alto e il basso ?

    ho risolto con un iframe ma ho il problema del doppio scroll come posso fare un iframe autosize ?
    grazie

  2. #2
    Utente di HTML.it L'avatar di alpeweb
    Registrato dal
    Oct 2002
    Messaggi
    1,691
    Non è propriamente una domanda da "PHP" cmq:

    nella pagina da caricare:
    <script type="text/javascript">
    function goSetHeight() {
    if (parent == window) return;
    else parent.setIframeHeight('ifrm');
    }
    </script>

    mentre in quella che ospita:

    <script type="text/javascript">
    function getDocHeight(doc) {
    var docHt = 0, sh, oh;
    if (doc.height) docHt = doc.height;
    else if (doc.body) {
    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
    if (sh && oh) docHt = Math.max(sh, oh);
    }
    return docHt;
    }

    function setIframeHeight(iframeName) {
    var iframeWin = window.frames[iframeName];
    var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
    if ( iframeEl && iframeWin ) {
    iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous
    var docHt = getDocHeight(iframeWin.document);
    // need to add to height to be sure it will all show
    if (docHt) iframeEl.style.height = docHt + 30 + "px";
    }
    }

    function loadIframe(iframeName, url) {
    if ( window.frames[iframeName] ) {
    window.frames[iframeName].location = url;
    return false;
    }
    else return true;
    }
    </script>

    Naturalmente all'iframe devi dare un id
    ...altri 5 anni di purga...

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.