qualcuno capisce perchè non funziona con FF e chrome?
codice:<style type="text/css"> body{background:#FFF} .divesterno { width: 200px; height:5px; margin: 0.5em 0; border: 1px solid #CCC; padding: 1px; font: 12px/16px Arial,sans-serif; text-align: left; } .divinterno { height:5px; width:0px; background:red; background-image:url('fiamme.gif'); background-repeat:repeat-x; } </style> <script> // VARIABILI NECESSARIE /* contenitore id del div della barra interna tot_secondi tempo di azione numvar indice dell'array con cui va avanti nomevariabile variabile di avanzamento divesternowidth larghezza div esterno larghezza iniziale del div */ contatore = new Array(100); function avvia(contenitore,tot_secondi,numvar,nomevariabile,divesternowidth,startwidth,label) { // if (document.getElementById(contenitore).clientWidth <= startwidth) // { document.getElementById(contenitore).style.width=startwidth + "px"; document.getElementById(label).innerHTML=parseInt(divesternowidth)-parseInt(startwidth); nomevariabile=setInterval('avanza(\''+contenitore+'\',\''+numvar+'\',\''+nomevariabile+'\',\''+divesternowidth+'\',\''+label+'\')',tot_secondi); contatore[numvar]=0; // } } function avanza(contenitore,numvar,nomevariabile,divesternowidth,label) { if(contatore[numvar] < divesternowidth) { var divdagestire=document.getElementById(contenitore); var divlabel=document.getElementById(label); divdagestire.style.width=divdagestire.clientWidth+1; divlabel.innerHTML=parseInt(divesternowidth)-parseInt(divdagestire.style.width); ++contatore[numvar]; } else { clearInterval(nomevariabile); } } </script> </head> <body> <div align="center" style="background-color:white;padding:3px"> <div class="divesterno"><div id="div1" class='divinterno'></div></div> <div id="label1"></div> <a href onClick="avvia('div1',1000,1,'avanz1',200,50,'label1');">Inizia la barra 1</a> <div class="divesterno"><div id="div2" class='divinterno'></div></div> <div id="label2"></div> <a href onClick="avvia('div2',1000,1,'avanz2',200,0,'label2');">Inizia la barra 2</a>

Rispondi quotando