Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    javascriptino con array

    ciao, mi serve aiuto!!
    codice:
    function hideTip(obj) {
        if  (document.layers) {
            if (document.layers[obj] != null) {
                document.layers[obj].visibility = 'hidden';
            }
        }
        else if (document.all) {
            document.all[obj].style.visibility = 'hidden';
        }
        else if (document.getElementById(obj)) {
            document.getElementById(obj).style.visibility = 'hidden';
        }
    }
    function switchTip(obj) {
    	var arr = new Array();
    	var tip;
            arr[0] = 'bre_adr'
    	arr[1] ='ham_adr';
    	arr[2] ='ber_adr';
    	arr[3] ='lei_adr';
    	arr[4] ='dre_adr';
    	arr[5] ='nur_adr';
    	arr[6] ='mun_adr';
    	arr[7] ='dus_adr';
        if (document.layers) {
            if (document.layers[obj] != null) {
                el_st = document.layers[obj];
            }
        }
        else if (document.all) {
            el_st = document.all[obj].style;
        }
        else if (document.getElementById(obj)) {
            el_st = document.getElementById(obj).style;
        }
    	for (i=0; i<8; i+1) {
            tip = arr[i];
    		hideTip(tip);
    	}
    	el_st.visibility = (el_st.visibility=="visible") ? "hidden" : "visible";
    }
    non capisco nulla, quando eseguo lo script mozilla mi dice che mi blocchera' il computer e mi chiede di bloccarlo.
    vabbe' sono inesperta in javascript..
    Success in life is a matter not so much of talent and opportunity as of concentration and perseverance.

  2. #2
    Utente di HTML.it L'avatar di willybit
    Registrato dal
    May 2001
    Messaggi
    4,367
    Ciao webfrancy,

    sbagli il ciclo for che dovrebbe essere così
    codice:
    for (i=0; i<8; i++) {

  3. #3
    Originariamente inviato da willybit
    Ciao webfrancy,

    sbagli il ciclo for che dovrebbe essere così
    codice:
    for (i=0; i<8; i++) {
    ma dai, si scrive proprio come in php e io me lo sono lasciato sfuggire..
    molte grazie
    Success in life is a matter not so much of talent and opportunity as of concentration and perseverance.

  4. #4
    Utente di HTML.it L'avatar di willybit
    Registrato dal
    May 2001
    Messaggi
    4,367
    Originariamente inviato da webfrancy
    ma dai, si scrive proprio come in php e io me lo sono lasciato sfuggire..
    molte grazie
    capita anche nelle migliori famiglie

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.