1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
   | function show_popup(image,hauteurs,largeurs)
	{
		//si l'image existe déja, on la delete pour en replacer une autre direct
		if(document.getElementById('test'))
		{
			var noeud=document.getElementsByTagName("div")[5].childNodes[1];
			disparu = document.getElementsByTagName("div")[5].removeChild(noeud);
		}									
		var nouveauB = document.createElement("div");			
		var texte_nouveauB = document.createTextNode("");
		nouveauB.appendChild(texte_nouveauB);
		nouveauB.setAttribute("id","test");
		nouveauB.setAttribute("style","-moz-opacity:0;");
		//si c'est ie
		if(!!document.all)
		{		nouveauB.style.setAttribute("cssText","filter:alpha(opacity=0);");}
 
		document.getElementById("toto").insertBefore(nouveauB, document.getElementById("tata"));				
			document.getElementById('test').style.display = "block";
		var test = document.getElementById('test')
		test.style.width = largeurs+'px';
		test.style.height = hauteurs+'px';
		test.style.backgroundImage = 'url('+image+')';
		test.style.marginLeft = "auto";
		test.style.marginRight = "auto";
		test.style.zIndex = 100;
 
//_______OPACITE__________ code de spaceFrog
 
		var max = 100;
		var min = 0;
		var opacite=min;
		up=true;
		var IsIE=!!document.all;
		var ThePic=document.getElementById("test");
		function fadePic()
		{		
			if (opacite<max && up)
			{opacite +=4;}
			//	if (opacite>min && !up){opacite-=2;}
			if (opacite>=max){up=false;}
			 if   (opacite<=min){up=true;}
			IsIE?ThePic.filters[0].opacity=opacite:document.getElementById("test").style.opacity=opacite/100;
		}
	   setInterval(function(){fadePic();},100)		
 
	} | 
Partager