bluetoother Posted December 12, 2007 Share Posted December 12, 2007 i need simple javascript to make 2 images fade Link to comment Share on other sites More sharing options...
aspnetguy Posted December 12, 2007 Share Posted December 12, 2007 can you be more specific. Fade in or fade out. Do both images fade at the same time????? Link to comment Share on other sites More sharing options...
bluetoother Posted December 13, 2007 Author Share Posted December 13, 2007 fade the image inthen fade out Link to comment Share on other sites More sharing options...
rnd me Posted December 13, 2007 Share Posted December 13, 2007 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 More sharing options...
bluetoother Posted December 13, 2007 Author Share Posted December 13, 2007 thanks i appreciate it Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.