Help with adding delay to rotating testimonials
I'm using this script to present a rotating testimonials page with fade-in and out effects. This could be very messy code, I'm not very sure what I'm doing but I've managed to get this working so far. I'd like it to delay before rotating to the next one but I'm struggling without breaking the rest of my code. Thanks for the help! You can see it in action here
http://dvgmusic.com/
- (document).ready(function(){
- $('#testimonials .slide');
- setInterval(function(){
- $('#testimonials .slide').filter(':visible').fadeOut(3000,function(){
- if($(this).html() != $("#testimonials .slide:last").html()){
- var nextItem = $(this).next();
- $("#testimonials").animate({height: nextItem.outerHeight() + "px"}, 100, function()
- {
- nextItem.fadeIn(2000);
- });
- }
- else{
- $("#testimonials").animate({height: $('#testimonials .slide:first').outerHeight() + "px"}, 100, function()
- {
- $('#testimonials .slide:first').fadeIn(2000);
- });
- }
- });
- },5000);
- });