jQuery fadeOut() function doesn't ALWAYS work in Chrome, Firefox, IE
Posted
by user365568
on Stack Overflow
See other posts from Stack Overflow
or by user365568
Published on 2010-06-13T07:25:39Z
Indexed on
2010/06/13
7:32 UTC
Read the original article
Hit count: 206
Sometimes, the slideshow on my website, which uses fadeOut and fadeIn to cycle through three main images, will fadeIn a new photo without fading in the old one. This doesn't happen every time the page loads though. My site is here (the slideshow will take 7 seconds to change): http://codersarepeople.com/v2/
The code I use is this:
slideshow = new Array('#slideshow1','#slideshow2','#slideshow3');
var i = Math.floor(Math.random()*3);
$(slideshow[i]).fadeIn(125);
var t = setInterval(function() {
$(slideshow[i%3]).fadeOut(250,function() {
$(slideshow[(i+1)%3]).fadeIn(250);
});
i++;
},7000);
© Stack Overflow or respective owner