Autor Zpráva
Alex_alex
Profil
Dobrý den, mám tento script na slideshow, ale když to dojede k obrázku W9.jpg, tak se to zastaví a nehne :( a já bych potřeboval aby to jelo zase odznova.
function iPhonesl(){
iPhonefademi=1;
imgarr=new Array();
imgstr=new Array();
linkstr=new Array();
clslinkstr=new Array();
imgarr[0]=new Image();
imgarr[0].src='W.jpg';
imgstr[0]='W.jpg';
linkstr[0]='';
clslinkstr[0]='';
imgarr[1]=new Image();
imgarr[1].src='W2.jpg';
imgstr[1]='W2.jpg';
linkstr[1]='';
clslinkstr[1]='';
imgarr[2]=new Image();
imgarr[2].src='W3.jpg';
imgstr[2]='W3.jpg';
linkstr[2]='';
clslinkstr[2]='';
imgarr[3]=new Image();
imgarr[3].src='W4.jpg';
imgstr[3]='W4.jpg';
linkstr[3]='';
clslinkstr[3]='';
imgarr[4]=new Image();
imgarr[4].src='W5.jpg';
imgstr[4]='W5.jpg';
linkstr[4]='';
clslinkstr[4]='';
imgarr[5]=new Image();
imgarr[5].src='W6.jpg';
imgstr[5]='W6.jpg';
linkstr[5]='';
clslinkstr[5]='';
imgarr[6]=new Image();
imgarr[6].src='W7.jpg';
imgstr[6]='W7.jpg';
linkstr[6]='';
clslinkstr[6]='';
imgarr[7]=new Image();
imgarr[7].src='W8.jpg';
imgstr[7]='W8.jpg';
linkstr[7]='';
clslinkstr[7]='';
imgarr[8]=new Image();
imgarr[8].src='W9.jpg';
imgstr[8]='W9.jpg';
linkstr[8]='';
clslinkstr[8]='';
iPhonevcurr=0;
iPhonevnext=0;
iPhonevssdiv=null;
stepc=20*(2000/1000);
iPhonedif=0.00;
iPhoneop=1.00;
iPhonedif=(1.00/stepc);
uagent = window.navigator.userAgent.toLowerCase();
IEB=(uagent.indexOf('msie') != -1)?true:false;
var scompat = document.compatMode;
if(scompat != "BackCompat"){
}
dstr1='<div id="';
dstr2='" style="position:absolute;text-align:'+"center"+';width:'+320+'px;heigh t:'+480+'px;visibility:hidden;left:0px;top:0px;padding:0px;margin:0px; overflow:hidden;">';
dstr3='<img id="iPhoneimg';
dstr4='" src="';
dstr5='" style="position:relative;left:0px;top:0px;padding:0px;margin:0px;borde r:0px;" alt="" border="0"></img>';
dstr6='</div>';
this.iPhonedotrans=iPhonedotrans;
this.iPhoneinitte=iPhoneinitte;
this.iPhoneinitte2=iPhoneinitte2;
this.iPhonebeftrans=iPhonebeftrans;
this.iPhonedotransff=iPhonedotransff;
}function iPhonedotrans(){
	if(IEB==true){
iPhonevssdiv.filters[0].apply();
}
	iPhoneobjc=document.getElementById('iPhoned'+iPhonevcurr);
	iPhoneobjn=document.getElementById('iPhoned'+iPhonevnext);
	iPhoneobjc.style.visibility="hidden";
	iPhoneobjn.style.visibility="visible";
	if(IEB==true){iPhonevssdiv.filters[0].play();
}
		iPhonevcurr=iPhonevnext;
	iPhonevnext=iPhonevnext+1
;		if(iPhonevnext>=10)
	{
		iPhonevnext=0;
	}
			setTimeout('iPhonedotrans()',(2000+3000));
	}
function iPhonedotransff(){
	iPhoneop=iPhoneop-iPhonedif;
	iPhoneobjc=document.getElementById('iPhoned'+iPhonevcurr);
	iPhoneobjn=document.getElementById('iPhoned'+iPhonevnext);
	if(iPhoneop<(0.00)){iPhoneop=0.00;
	}
	iPhoneobjc.style.opacity = iPhoneop;
	iPhoneobjn.style.opacity = 1.00;
	if(iPhoneop>(0.00))
	{
		setTimeout('iPhonedotransff()',50);
	}	else
	{
		iPhoneobjc.style.zIndex=2;
		iPhoneobjn.style.zIndex=3;
		setTimeout('iPhonebeftrans()',3000);
	}}
function iPhonebeftrans(){
	iPhonevcurr=iPhonevnext;
	iPhonevnext=iPhonevnext+1;
	if(iPhonevnext>=10)
	{	
	iPhonevnext=0;
	}
	iPhoneop=1.00;
	iPhoneobjc=document.getElementById('iPhoned'+iPhonevcurr);
	iPhoneobjn=document.getElementById('iPhoned'+iPhonevnext);
	iPhoneobjc.style.visibility="visible";
	iPhoneobjn.style.visibility="visible";
	iPhoneobjc.style.zIndex=3;
	iPhoneobjn.style.zIndex=2;
	iPhoneobjc.style.opacity = 1.00;
	iPhoneobjn.style.opacity = 1.00;
			iPhonedotransff();
	}function iPhoneinitte2(){
	iPhonevssdiv=document.getElementById("iPhonedv");
	if(2>0)	{
		iPhoneobjc=document.getElementById('iPhoned'+0);
			iPhoneobjc.style.visibility="visible";
		}
		if(10>1)
		{
		if((IEB==true)||(iPhonefademi==0))
		{	
		iPhonevcurr=0;
			iPhonevnext=1;
			setTimeout('iPhonedotrans()',3000);
		}
		else
		{
			iPhonevcurr=0;
			iPhonevnext=0;
			setTimeout('iPhonebeftrans()',3000);
		}
	}
}function iPhoneinitte(){
	i=0;	innertxt="";
	for(i=0;i<10;i++)
	{
		innertxt=innertxt+dstr1+"iPhoned"+i+dstr2+linkstr[i]+dstr3+i+dstr4+i mgstr[i]+dstr5+clslinkstr[i]+dstr6;
	}
	spage=document.getElementById('iPhonedv');
	spage.innerHTML=""+innertxt;
	setTimeout('iPhoneinitte2()',200);
}
iPhones=new iPhonesl();
iPhones.iPhoneinitte();
peta
Profil
Alex_alex
odkaz na stranku? Nevis, ze toto forum po 40 znaku da mezeru? Kdybych si to zkopiroval, tak musim dohledavat ty mezery. Coz mne desne nebavi. Otazka je, zda se nekdo takovy najde?

Co hlasi JS konzola?
podle scriptu:
if(iPhonevnext>=10)
{
iPhonevnext=0;
}
se to nuluje a zacina zas od zacatku za 3+2 sekund. Ale nejsem si jistej, jestli je to ono. Mozna JS konzola pred tim vyhlasi nejakou chybu, protoze jde od obrazku 0 do 9 , coz je 10 obrazku. ty pises o w9, to je v imgstr[8], a v image[9] mas co?

Co kdyby, kdyz uz si kopirujes galerii jsi pracoval s funkcni verzi afunkcni si zalohoval, treba *.f1 *.f2 atd . A pripade, ze to rozvrtas, tak se vratis k posledni funkcni.
Alex_alex
Profil
Už jsem to vyřešil, já blbec měl špatný ID :D

Vaše odpověď

Mohlo by se hodit

Neumíte-li správně určit příčinu chyby, vkládejte odkazy na živé ukázky.
Užíváte-li nějakou cizí knihovnu, ukažte odpovídajícím, kde jste ji vzali.

Užitečné odkazy:

Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0