Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    2,125

    script che va in explorer ma non in mozilla

    ciao . qualcuno riesce a farmi funzionare il seguente script anche su mozilla???
    se ce la fate vi amero' a vita

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>SimplytheBest DHTML tabbed notes script</title>
    <meta name="keywords" content="DHTML scripts, tab, notes, messages">
    <meta name="keywords" content="DHTML scripts, tabbed notes, tab, notes, dhtml script, javascript">
    <meta name="description" content="Simply the Best DHTML scripts and javascripts: tabbed notes.">
    <meta name="target" content="DHTML scripts, tabbed notes">
    <meta name="copyright" content="copyright 1997-2005 SimplytheBest.net">
    <meta name="revisit-after" content="14 days">
    <meta name="robots" content="all">
    <link rel="stylesheet" href="../scripts.css" type="text/css">
    <style>
    <!--
    .conts { visibility: hidden }
    .tab { font-family: Verdana; font-size: 8pt; font-weight: normal; text-align: center;
    border-left: thin solid #e0e0e0; border-right: thin solid gray;
    border-top: thin solid #e0e0e0 }
    .selTab { font-family: Verdana; font-size: 8pt; font-weight: bold; text-align: center;
    border-left: thin solid #000080;
    border-right: thin solid #000080;
    border-top: thin solid #000080 }
    -->
    </style>
    <SCRIPT language=JavaScript>
    // Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
    //a public function that the container uses to pass in values for the labels
    function public_Labels(label1, label2, label3, label4, label5, label6, label7){

    t1.innerText = label1;
    t2.innerText = label2;
    t3.innerText = label3;
    t4.innerText = label4;
    t5.innerText = label5;
    t6.innerText = label6;
    t7.innerText = label7;
    }
    //a public function that the container uses to pass in values for the card containers
    function public_Contents(contents1, contents2, contents3, contents4, contents5, contents6, contents7){
    t1Contents.innerHTML = contents1;
    t2Contents.innerHTML = contents2;
    t3Contents.innerHTML = contents3;
    t4Contents.innerHTML = contents4;
    t5Contents.innerHTML = contents5;
    t6Contents.innerHTML = contents6;
    t7Contents.innerHTML = contents7;
    init();
    }
    //sets the default display to tab 1
    function init(){
    tabContents.innerHTML = t1Contents.innerHTML;
    }
    //this is the tab switching function
    var currentTab;
    var tabBase;
    var firstFlag = true;
    function changeTabs(){
    if(firstFlag == true){
    currentTab = t1;
    tabBase = t1base;
    firstFlag = false;
    }
    if(window.event.srcElement.className == "tab"){
    currentTab.className = "tab";
    tabBase.style.backgroundColor = "white";
    currentTab = window.event.srcElement;
    tabBaseID = currentTab.id + "base";
    tabContentID = currentTab.id + "Contents";
    tabBase = document.all(tabBaseID);
    tabContent = document.all(tabContentID);
    currentTab.className = "selTab";

    tabBase.style.backgroundColor = "";
    tabContents.innerHTML = tabContent.innerHTML;
    }
    }
    </SCRIPT>
    </head>
    <body onclick="changeTabs()" onload="init()" text="#000000" link="#0000A0" vlink="#0000A0" alink="#0000A0" topmargin="10" leftmargin="10" marginheight="10" marginwidth="10">





    <table bgcolor="#FFA500" cellpadding="0" cellspacing="0" style="HEIGHT: 300px; WIDTH: 700px" class="body">
    <tbody>
    <tr>
    <td class="selTab" height="25" id="t1">TwineXp</td>
    <td class="tab" id="t2">Network</td>
    <td class="tab" id="t3">Emulatore</td>
    <td class="tab" id="t4">Utenti</td>

    </tr>
    <tr>
    <td id="t1base" style="BORDER-LEFT: gray thin solid; HEIGHT: 1px"></td>
    <td id="t2base" style="BACKGROUND-COLOR: white; HEIGHT: 1px"></td>
    <td id="t3base" style="BACKGROUND-COLOR: white; HEIGHT: 1px"></td>
    <td id="t4base" style="BACKGROUND-COLOR: white; HEIGHT: 1px"></td>

    </tr>
    <tr>
    <td colspan="7" height="*" id="tabContents" style="BORDER-BOTTOM: gray thin solid; BORDER-LEFT: gray thin solid; BORDER-RIGHT: gray thin solid"></td>
    </tr>
    </tbody>
    </table>
    </div>
    <div class="conts" id="t1Contents" style="width: 500; height: 10">
    pag1
    </div>
    <div class="conts" id="t2Contents" style="width: 459; height: 120">
    <p class="body" align="center"> This is the power of DHTML.
    <p class="body" align="center">This is a great way to navigate. In addition,
    the text on the tags work just like any other HTML text. You can put in images,
    links, or just about anything you could put in a traditional HTML document.

    Go to Tab 3 to continue...</p>
    </div>
    <div class="conts" id="t3Contents" style="width: 460; height: 38">
    <p class="body" align="center">DHTML Script</p>
    <p class="body" align="center">Get this.
    <p align="center" class="body"><font color="#000080">Go to Tab 4...</font></p>
    </div>
    <div class="conts" id="t4Contents" style="width: 460; height: 88">
    <p align="center" class="body">Putting Information On The Tabs

    You can change any text, add tabs and much more.
    </p>
    <p align="center" class="body"><font color="#000080">Continue to
    Tab 5...</font>
    </p>
    </div>
    <div class="conts" id="t5Contents" style="width: 460; height: 37">
    <p align="center" class="body">And so on..</p>
    </div>
    <div class="conts" id="t6Contents" style="width: 460; height: 37">
    <p align="center" class="body">And so on..</p>
    </div>

    <div class="conts" id="t7Contents" style="width: 460; height: 37">
    <p align="center" class="body">
    Scroll a little down the page for instructions!
    </p>
    </div>

    </body>
    </html>

  2. #2
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    2,125
    up please...

    la consol java di mozilla dice
    errore
    window.event has no proprieties

    non so assolutamente come risolvere.....help maghi di javascript

    thx in partenza

  3. #3
    Utente di HTML.it L'avatar di Nazareno
    Registrato dal
    Mar 2001
    residenza
    Udine
    Messaggi
    176

    Eccolo...

    OK. Prima di tutto bisogna usare document.getElementById per riferirsi agli elementi e bisogna evitare window.event, che funziona solo in IE, sostituendolo con chiamate dirette su onclick. Ecco lo script (dai un'occhiata anche a questo interessante articolo: http://www-128.ibm.com/developerwork...y/wa-ie2mozgd/)

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>SimplytheBest DHTML tabbed notes script</title>
    <meta name="keywords" content="DHTML scripts, tab, notes, messages">
    <meta name="keywords" content="DHTML scripts, tabbed notes, tab, notes, dhtml script, javascript">
    <meta name="description" content="Simply the Best DHTML scripts and javascripts: tabbed notes.">
    <meta name="target" content="DHTML scripts, tabbed notes">
    <meta name="copyright" content="copyright 1997-2005 SimplytheBest.net">
    <meta name="revisit-after" content="14 days">
    <meta name="robots" content="all">
    <link rel="stylesheet" href="../scripts.css" type="text/css">
    <style>
    <!--
    .conts { visibility: hidden }
    .tab { font-family: Verdana; font-size: 8pt; font-weight: normal; text-align: center;
    border-left: thin solid #e0e0e0; border-right: thin solid gray;
    border-top: thin solid #e0e0e0 }
    .selTab { font-family: Verdana; font-size: 8pt; font-weight: bold; text-align: center;
    border-left: thin solid #000080;
    border-right: thin solid #000080;
    border-top: thin solid #000080 }
    -->
    </style>
    <SCRIPT language=JavaScript>
    // Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
    //a public function that the container uses to pass in values for the labels
    function public_Labels(label1, label2, label3, label4, label5, label6, label7){

    document.getElementById("t1").innerText = label1;
    document.getElementById("t2").innerText = label2;
    document.getElementById("t3").innerText = label3;
    document.getElementById("t4").innerText = label4;
    document.getElementById("t5").innerText = label5;
    document.getElementById("t6").innerText = label6;
    document.getElementById("t7").innerText = label7;
    }
    //a public function that the container uses to pass in values for the card containers
    function public_Contents(contents1, contents2, contents3, contents4, contents5, contents6, contents7){
    document.getElementById("t1Contents").innerHTML = contents1;
    document.getElementById("t2Contents").innerHTML = contents2;
    document.getElementById("t3Contents").innerHTML = contents3;
    document.getElementById("t4Contents").innerHTML = contents4;
    document.getElementById("t5Contents").innerHTML = contents5;
    document.getElementById("t6Contents").innerHTML = contents6;
    document.getElementById("t7Contents").innerHTML = contents7;
    init();
    }
    //sets the default display to tab 1
    function init(){
    document.getElementById("tabContents").innerHTML = document.getElementById("t1Contents").innerHTML;
    }
    //this is the tab switching function
    var currentTab;
    var tabBase;
    var firstFlag = true;
    function changeTabs(tabID){
    if(firstFlag == true){
    currentTab = document.getElementById("t1");
    tabBase = document.getElementById("t1base");
    firstFlag = false;
    }
    if(document.getElementById(tabID).className == "tab"){
    currentTab.className = "tab";
    tabBase.style.backgroundColor = "white";
    currentTab = document.getElementById(tabID);
    tabBaseID = currentTab.id + "base";
    tabContentID = currentTab.id + "Contents";
    tabBase = document.getElementById(tabBaseID);
    tabContent = document.getElementById(tabContentID);
    currentTab.className = "selTab";

    tabBase.style.backgroundColor = "";
    document.getElementById("tabContents").innerHTML = tabContent.innerHTML;
    }
    }
    </SCRIPT>
    </head>
    <body onload="init()" text="#000000" link="#0000A0" vlink="#0000A0" alink="#0000A0" topmargin="10" leftmargin="10" marginheight="10" marginwidth="10">





    <table bgcolor="#FFA500" cellpadding="0" cellspacing="0" style="HEIGHT: 300px; WIDTH: 700px" class="body" ID="Table1">
    <tbody>
    <tr>
    <td class="selTab" onclick="changeTabs('t1')" height="25" id="t1">TwineXp</td>
    <td class="tab" onclick="changeTabs('t2')" id="t2">Network</td>
    <td class="tab" onclick="changeTabs('t3')" id="t3">Emulatore</td>
    <td class="tab" onclick="changeTabs('t4')" id="t4">Utenti</td>

    </tr>
    <tr>
    <td id="t1base" style="BORDER-LEFT: gray thin solid; HEIGHT: 1px"></td>
    <td id="t2base" style="BACKGROUND-COLOR: white; HEIGHT: 1px"></td>
    <td id="t3base" style="BACKGROUND-COLOR: white; HEIGHT: 1px"></td>
    <td id="t4base" style="BACKGROUND-COLOR: white; HEIGHT: 1px"></td>

    </tr>
    <tr>
    <td colspan="7" height="*" id="tabContents" style="BORDER-BOTTOM: gray thin solid; BORDER-LEFT: gray thin solid; BORDER-RIGHT: gray thin solid"> </td>
    </tr>
    </tbody>
    </table>
    </div>
    <div class="conts" id="t1Contents" style="width: 500; height: 10">
    pag1
    </div>
    <div class="conts" id="t2Contents" style="width: 459; height: 120">
    <p class="body" align="center"> This is the power of DHTML.
    <p class="body" align="center">This is a great way to navigate. In addition,
    the text on the tags work just like any other HTML text. You can put in images,
    links, or just about anything you could put in a traditional HTML document.

    Go to Tab 3 to continue...</p>
    </div>
    <div class="conts" id="t3Contents" style="width: 460; height: 38">
    <p class="body" align="center">DHTML Script</p>
    <p class="body" align="center">Get this.
    <p align="center" class="body"><font color="#000080">Go to Tab 4...</font></p>
    </div>
    <div class="conts" id="t4Contents" style="width: 460; height: 88">
    <p align="center" class="body">Putting Information On The Tabs

    You can change any text, add tabs and much more.
    </p>
    <p align="center" class="body"><font color="#000080">Continue to
    Tab 5...</font>
    </p>
    </div>
    <div class="conts" id="t5Contents" style="width: 460; height: 37">
    <p align="center" class="body">And so on..</p>
    </div>
    <div class="conts" id="t6Contents" style="width: 460; height: 37">
    <p align="center" class="body">And so on..</p>
    </div>

    <div class="conts" id="t7Contents" style="width: 460; height: 37">
    <p align="center" class="body">
    Scroll a little down the page for instructions!
    </p>
    </div>

    </body>
    </html>

  4. #4
    Utente di HTML.it
    Registrato dal
    Jun 2005
    Messaggi
    2,125
    ....che dirti..... GRAZIE , GRAZIE , GRAZIE di cuore

    se stato gentilissimo a mettermi alnche il codice funzionante su mozillone.



    potro' mai sdebitarmi ?

    ciao e buon proseguimento

    grazie ancora

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 © 2024 vBulletin Solutions, Inc. All rights reserved.