Jump to content

image fading


bluetoother

Recommended Posts

var IE=(!! document.all);function setTrans(elm, per) { 	var  g = elm.type == "string" ? el(elm) : elm; 	if(per || per==0)  {  setTrans.i=per;}	g.style[setTrans.key]=setTrans.o();} setTrans.i=1;  setTrans.key=(IE)? setTrans.key="filter":"opacity";  setTrans.o=(IE?  (function(){ return "alpha(opacity='"+(setTrans.i * 100) +"')" }) :(function(){ return  setTrans.i }) );function fadeOut(elm){	if(setTrans.i>0){	   setTrans.i-=0.08; 	   setTrans(elm);	   setTimeout(function(){ fadeOut(elm)}, 35)	} else { setTrans.i=0; setTrans(elm,0); }}//end fade outfunction fadeIn(elm){	if(setTrans.i < 1){  	   setTrans.i+=0.08; 	   setTrans(elm);	   setTimeout(function(){ fadeIn(elm)}, 35)	} else {  setTrans(elm,1); }}//end fade in//ex//fadeOut(document.body)//fadeIn(document.body)

for your purposes, call fadeOut on the first image, then immediately call fadeIn on the second image

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...