Page 1 sur 1

probleme d'affichage image avec js sous ff

Publié : 24 mars 2005, 11:55
par mister mo
J'ai recupere ce code sur le site de l'editeur Javascript qui me signale que ca fonctionne sous ff. Malheureusement sous ie pas de probleme mais sous ff rien ne s'affiche.
Merci d'avance de bien vouloir m'éclairer car je ne connais pas assez bien le javascript

Voici le code pour head :

Code : Tout sélectionner

<SCRIPT language="JavaScript">
imgPath = new Array;
SiClickGoTo = new Array;
if (document.images)
	{
	i0 = new Image;
	i0.src = 'img/dept/nice1.jpg';
	SiClickGoTo[0] = "";
	imgPath[0] = i0.src;
	i1 = new Image;
	i1.src = 'img/dept/nice2.jpg';
	SiClickGoTo[1] = "";
	imgPath[1] = i1.src;
	i2 = new Image;
	i2.src = 'img/dept/nice3.jpg';
	SiClickGoTo[2] = "";
	imgPath[2] = i2.src;
	i3 = new Image;
	i3.src = 'img/dept/nice4.jpg';
	SiClickGoTo[3] = "";
	imgPath[3] = i3.src;
	i4 = new Image;
	i4.src = 'img/dept/nice5.jpg';
	SiClickGoTo[4] = "";
	imgPath[4] = i4.src;
	}
a = 0;
function ejs_img_fx(img)
	{
	if(img && img.filters && img.filters[0])
		{
		img.filters[0].apply();
		img.filters[0].play();
		}
	}

function StartAnim()
	{
	if (document.images)
		{
		document.write('<A HREF="#" onClick="ImgDest();return(false)"><IMG SRC="image1.jpg" BORDER=0 ALT=Menu NAME=defil style="filter:progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=100,Duration=1)"></A>');
		defilimg()
		}
	else
		{
		document.write('<A HREF="#1"><IMG SRC="image1.jpg" BORDER=0></A>')
		}
	}
function ImgDest()
	{
	document.location.href = SiClickGoTo[a-1];
	}
function defilimg()
	{
	if (a == 5)
		{
		a = 0;
		}
	if (document.images)
		{
		ejs_img_fx(document.defil)
		document.defil.src = imgPath[a];
		tempo3 = setTimeout("defilimg()",5000);
		a++;
		}
	}
<!-- FIN DU SCRIPT -->
</script>
Voici le code à mettre dans le BODY :

Code : Tout sélectionner

<script LANGUAGE="JavaScript">StartAnim()</script>

Publié : 24 mars 2005, 14:21
par SB
Si, si, ça marche, même si ça fait pas trèe pro.