Advertisement
honghoavi

Simple jQuery Slideshow - JS02

Jun 7th, 2012
12,465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function slideSwitch() {
  2.     var $active = $('#slideshow IMG.active');
  3.     var $next = $active.next();
  4.  
  5.     $active.addClass('last-active');
  6.  
  7.     $next.css({opacity: 0.0})
  8.         .addClass('active')
  9.         .animate({opacity: 1.0}, 1000, function() {
  10.             $active.removeClass('active last-active');
  11.         });
  12. }
  13.  
  14. $(function() {
  15.     setInterval( "slideSwitch()", 5000 );
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement