salve a tutti ho due funzioni che mi fanno un effetto di dissolveza su una presenzazione di immagini in una pagina html.
le funzioni vanno bene ma l'unica cosa che non capisco è perchè mi da un'errore(argomento non valido) sulla barra di stato...
vi posto il codice:
potete darmi una mano?codice:<script language="JavaScript"> //window.onload=runSlideShow; number_of_sponsors=3; var sctr=0; var halt=0; var isn=new Array(); for (i=0;i<number_of_sponsors;i++){ isn[i]=new Image(); } isn[0].src="RE4.gif"; isn[1].src="driver.gif"; isn[2].src="Marioparty8.gif"; var durl=new Array(); durl[0]="http://www.sito.it"; durl[1]="http://www.sito.it"; durl[2]="http://www.sito.it"; function rotateIt(){ if (halt!=1){ sctr++; if (sctr>number_of_sponsors-1){ sctr=0; } document.getElementById('asd').src=isn[sctr].src; setTimeout(opacity('asd', 100, 0, 2500), 0); } } function doIt(){ halt=1; parent.location.href=durl[sctr]; } function dispIt(){ parent.window.status=durl[sctr]; } function setStartNum(){ sctr=Math.round(Math.random()*number_of_sponsors); } function opacity(id, opacStart, opacEnd, millisec) { //speed for each frame var speed = Math.round(millisec / 100); var timer = 0; //determine the direction for the blending, if start and end are the same nothing happens if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } setTimeout(opacity2('asd', 0, 100, 2500), 2500); <-- qui mi da l'errore } function opacity2(id, opacStart, opacEnd, millisec) { //speed for each frame var speed = Math.round(millisec / 100); var timer = 0; //determine the direction for the blending, if start and end are the same nothing happens if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } setTimeout(rotateIt, 6000); } //change the opacity for different browsers function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } // End Hiding --> </script> <a href="#" target="home" onClick="doIt();return false" onMouseOver="window.status='www.wiimania.net'; return true;"> [img]gdfs[/img] </a> <script LANGUAGE="JavaScript"> <!-- Hide JavaScript from Java-Impaired Browsers setStartNum(); rotateIt(); // End Hiding --> </script>

Rispondi quotando