Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 28th, 2013  |  syntax: JavaScript  |  size: 0.71 KB  |  views: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /* Testimonials animation */
  2.  
  3. setTimeout(function() {quotesChange();}, 5000);
  4.              
  5. function quotesChange() {
  6.  
  7.    $(".quotes").each(function(index) {
  8.  
  9.       var quote = $(".quotes").eq(index);
  10.       var current = quote.children("article.quote-selected");
  11.       var next = quote.children("article").eq( current.index() + 1 );
  12.  
  13.       if (next.html() == null) {
  14.          next = quote.children("article").eq(0);
  15.       }
  16.  
  17.       current.removeClass("quote-selected");
  18.       next.addClass("quote-selected");
  19.       next.css("display", "none");
  20.       current.fadeOut(800, function () {
  21.          next.fadeIn(800, function() { });
  22.       });
  23.  
  24.    });
  25.    setTimeout(function() {quotesChange();}, 5000);
  26. }
clone this paste RAW Paste Data