I’m trying to fadeIn an fadeOut items in the array to a div. I’m trying to make this work in a fadeIn fadeOut manner. So first item fades in stays for 3 secodns then fades back out, then the next item fadein, 3seocnds then fade out and so on….. why is wrong with my code. Check http://jsfiddle.net/Fpu2E/1/
Share
The code you’re using won’t work for various reasons – having zero delay between calling
fadeOutandfadeInmeans you won’t get the 3 second delay you’re looking for between fading in and out, and that calling both functions lead to some strange effects with the jQuery effects queue.A better option would be to use a recursive function together with
delayto do this:A simple demo of this can be found here: http://jsfiddle.net/Fpu2E/4/