I have the following code that shows a slideshow. My problem is that one element is not fully hidden (fadeout) before the next one (fade in) appaears, causing me to have to fix it with CSS, which is not the ideal scenario.. this is the code:
setInterval(function() {
$('#slides > li:first')
.fadeOut(500)
.next()
.fadeIn(500)
.end()
.appendTo('#slidelist');
}, 2000);
I've tried the following without success:
setInterval(function() {
$('#slides > li:first')
.fadeOut(500).delay(500)
.next()
.fadeIn(500)
.end()
.appendTo('#slidelist');
}, 2000);
Any ideas how can I get the element fully faded out before the next one fades in?