Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery simultaneous fade-in-out Re: jQuery simultaneous fade-in-out

#127895
raulursu
Member

You also can use animate (can decrease opacity for some element and in the same time can increase the opacity for another element/elements).

See this example :[working demo](http://www.w4schools.org/simple-slideshow-12.html “jQuery animation”)

There is something like that:

current.animate({opacity: 0}

, {duration:interval,

step: function(now,fx) {next.css(“opacity”,1-now);}, //here is making the oposite opacity for another element. //for each step

complete:function() { current.removeClass(“current”);

current.css(“opacity”,””);

next.addClass(“current”);

shoot(id,interval); }

}

);