Visualizzazione dei risultati da 1 a 9 su 9
  1. #1
    Utente di HTML.it
    Registrato dal
    Aug 2005
    Messaggi
    13

    nascondi e visualizza div

    salve a tutti... ho un problema con i div. Quello che vorrei realizzare è questo: http://www.netlobo.com/div_hiding.html ma pur seguendo le istruzioni, che sono molto semplici, non ci sono riuscito. Il codice l'ho prelevato interamente da quel sito! Qualcuno sa darmi delucidazioni in merito? Grazie mille!!!

  2. #2
    Utente di HTML.it L'avatar di oronze
    Registrato dal
    Jun 2001
    Messaggi
    3,543
    posta come l'hai messo tu il codice....il codice proposto da quel sito non l'ho visto ma dovrebbe essere corretto. non penso che pubblichino un articolo con codice non testato!
    forse l'hai sistemato male

    No ai layout tabellari!

    Insulto libero: http://forum.html.it/forum/showthread.php?s=&postid=12524872#post12524872

  3. #3
    Utente di HTML.it
    Registrato dal
    Aug 2005
    Messaggi
    13
    Questo è il codice che ho inserito!

    <script language="JavaScript" type="text/JavaScript">
    <!--
    function hidePlot() {
    if (document.getElementById)
    {
    // this is the way the standards work
    var style2 = document.getElementById('plot').style;
    style2.display = style2.display? "":"block";
    }
    else if (document.all)
    {
    // this is the way old msie versions work
    var style2 = document.all['plot'].style;
    style2.display = style2.display? "":"block";
    }
    else if (document.layers)
    {
    // this is the way nn4 works
    var style2 = document.layers['plot'].style;
    style2.display = style2.display? "":"block";
    }
    }
    //-->
    </script>

    <div id="plot" style="display:none;">

    </div>

  4. #4
    Utente di HTML.it L'avatar di oronze
    Registrato dal
    Jun 2001
    Messaggi
    3,543
    codice:
    <html>
    <head>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function hidePlot() {
    if (document.getElementById)
    {
    // this is the way the standards work
    var style2 = document.getElementById('plot').style;
    style2.display = style2.display? "":"none";
    }
    else if (document.all)
    {
    // this is the way old msie versions work
    var style2 = document.all['plot'].style;
    style2.display = style2.display? "":"none";
    }
    else if (document.layers)
    {
    // this is the way nn4 works
    var style2 = document.layers['plot'].style;
    style2.display = style2.display? "":"none";
    }
    }
    //-->
    </script> 
    </head>
    <body>
    <div id="plot" style="display:show;">
    Contenuto del div
    </div>
    Nascondi / Mostra
    </body>
    </html>
    cliccando sul link lo nasconde e mostra....l'ho modificato appena...

    No ai layout tabellari!

    Insulto libero: http://forum.html.it/forum/showthread.php?s=&postid=12524872#post12524872

  5. #5
    Utente di HTML.it
    Registrato dal
    Aug 2005
    Messaggi
    13
    ti ringrazio moltissimo!!!!!
    vorrei farti un'altra domanda... secondo te è possibile metterne più di uno in una pagina di questi?? tipo con 3 o 4 div che si nascondono o si mostrano...?
    Grazie mille!!! Scusa ma sono alle prima armi con js!!

  6. #6
    Utente di HTML.it L'avatar di oronze
    Registrato dal
    Jun 2001
    Messaggi
    3,543
    nessun problema, ti aiuto volentieri....vorresti 4 link per ogni div o un link che ne nasconda 4?

    No ai layout tabellari!

    Insulto libero: http://forum.html.it/forum/showthread.php?s=&postid=12524872#post12524872

  7. #7
    Utente di HTML.it
    Registrato dal
    Aug 2005
    Messaggi
    13
    grazie! no che per ogni link mi nasconda un div con nome diverso... grazie!!!

  8. #8
    Utente di HTML.it L'avatar di oronze
    Registrato dal
    Jun 2001
    Messaggi
    3,543
    codice:
    <html>
    <head>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function hidePlot(nomediv) {
    if (document.getElementById)
    {
    // this is the way the standards work
    var style2 = document.getElementById(nomediv).style;
    style2.display = style2.display? "":"none";
    }
    else if (document.all)
    {
    // this is the way old msie versions work
    var style2 = document.all[nomediv].style;
    style2.display = style2.display? "":"none";
    }
    else if (document.layers)
    {
    // this is the way nn4 works
    var style2 = document.layers[nomediv].style;
    style2.display = style2.display? "":"none";
    }
    }
    //-->
    </script> 
    </head>
    <body>
    <div id="plot" style="display:show;">
    Id plot
    </div>
    <div id="max" style="display:show;">
    Id Max
    </div>
    Nascondi / Mostra plot
    Nascondi / Mostra Max
    </body>
    </html>
    e così via, studiati un attimino lo script e sarai in grado di personalizzartelo come preferisci...

    No ai layout tabellari!

    Insulto libero: http://forum.html.it/forum/showthread.php?s=&postid=12524872#post12524872

  9. #9
    Utente di HTML.it
    Registrato dal
    Aug 2005
    Messaggi
    13
    grazie mille! Sono riuscito nell'intento!!

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.