Visualizzazione dei risultati da 1 a 5 su 5
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2006
    Messaggi
    446

    JqueyTabs con pulsanti form

    Si può fare una cosa simile a questa usando i pulsanti di un form?
    http://stilbuero.de/jquery/tabs/#fragment-3
    Io ho 3 pulsanti a scelta e vorrei a seconda di quale pulsante scelgo mi compaia del testo diverso. Si può fare?

  2. #2
    Utente di HTML.it
    Registrato dal
    May 2006
    Messaggi
    446
    ho trovato quest'esempio nel forum
    http://forum.html.it/forum/showthrea...readid=1145200
    solo che quando clicco su una check box non mi compare niente e mi dà errore (mi compare il tringolo giallo con punto esclamativo in fondo alla pagina)
    Vi metto il codice di load.js
    codice:
    var req;
    function loadXMLDoc(key) {
       var url="prova.php?tipo="+key;
       getObject("campi").innerHTML = ' Attendere Prego...';
       try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
       catch(e) {
          try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
          catch(oc) { req = null; }
       }
       if (!req && typeof XMLHttpRequest != "undefined") { req = new 
    XMLHttpRequest(); }
       if (req != null) {
          req.onreadystatechange = processChange;
          req.open("GET", url, true);
          req.send(null);
       }
    }
    function processChange() {
       if (req.readyState == 4 && req.status == 200) {
          getObject("zona").innerHTML = req.responseText;
          document.res_request.state.focus();
       }
    }
    
    function getObject(name) {
       var ns4 = (document.layers) ? true : false;
       var w3c = (document.getElementById) ? true : false;
       var ie4 = (document.all) ? true : false;
    
       if (ns4) return eval('document.' + name);
       if (w3c) return document.getElementById(name);
       if (ie4) return eval('document.all.' + name);
       return false;
    }
    Dov'è l'errore?

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2006
    Messaggi
    446
    niente ho capito, era sbagliato il tag "zona" che non esiste nel mio sito.
    Grazie comunque

  4. #4
    Utente di HTML.it L'avatar di pietro09
    Registrato dal
    Jan 2002
    Messaggi
    10,116
    questo è un esempio semplice; non so se ti possa servire :master:
    codice:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>Pagina senza titolo</title>
    
        <script language="javascript" type="text/javascript">
    // <!CDATA[
    function button_click(v)
    {
        var n = v.id.substr(6);
        for(var i = 1; i <= 3; i++) document.getElementById("div" + i).style.display = "none";
        document.getElementById("div" + n).style.display = "";
    }
    
    // ]]>
        </script>
    
    </head>
    <body>
        <input id="Button1" type="button" value="button1" onclick="button_click(this);" />
        <input id="Button2" type="button" value="button2" onclick="button_click(this);" />
        <input id="Button3" type="button" value="button3" onclick="button_click(this);" />
        <hr />
        <div id="div1" style="display:none;">Scritta per button1</div>
        <div id="div2" style="display:none;">Scritta per button2</div>
        <div id="div3" style="display:none;">Scritta per button3</div>
    </body>
    </html>
    Pietro

  5. #5
    Utente di HTML.it
    Registrato dal
    May 2006
    Messaggi
    446
    grazie

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.