Halfway through fadeOut callback
I want it so a fadeIn occurs halfway through a fadeOut
Obviously this won't work via the callback because it waits for the fadeOut to complete entirely.
I just want my list item to fade in halfway through the current fade out so there is a nicer transition.
Heres my code:
- <script type="text/javascript">
function switchSlide ()
{
var current = ($('.slider ul li.current'));
var next = (current.next().length) ? current.next() : $('.slider ul li:first');
current.fadeOut(1000, function() { next.fadeIn(1000).addClass('current'); }).removeClass('current');
}
$(document).ready(function() {
$('.slider ul li.current').fadeIn(1000, function() { setInterval(switchSlide, 5000); });
});
</script>
Also I have a SPAN inside the LI's, and I wanted to make it so that the span fades in right after the LI, then fades out right before the Li but I couldn't figure out it.
Any help is appreciated.