annotate media/js/slideshow.js @ 162:6a5bdcf93ad3

Fix #48; shoutbox was no longer escaping user input on display.
author Brian Neal <bgneal@gmail.com>
date Tue, 22 Dec 2009 03:55:37 +0000
parents a5b4c5ce0658
children
rev   line source
bgneal@45 1 /***
bgneal@45 2 Simple jQuery Slideshow Script
bgneal@45 3 Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc. Please link out to me if you like it :)
bgneal@45 4 ***/
bgneal@45 5 // Modified by Brian Neal.
bgneal@45 6
bgneal@45 7 function slideSwitch() {
bgneal@45 8 var $active = $('#slideshow img.active');
bgneal@45 9
bgneal@45 10 if ( $active.length == 0 ) $active = $('#slideshow img:last');
bgneal@45 11
bgneal@45 12 // use this to pull the images in the order they appear in the markup
bgneal@45 13 var $next = $active.next().length ? $active.next()
bgneal@45 14 : $('#slideshow img:first');
bgneal@45 15
bgneal@45 16 $active.addClass('last-active');
bgneal@45 17
bgneal@45 18 $next.css({opacity: 0.0})
bgneal@45 19 .addClass('active')
bgneal@45 20 .animate({opacity: 1.0}, 1000, function() {
bgneal@45 21 $active.removeClass('active last-active');
bgneal@45 22 });
bgneal@45 23 }
bgneal@45 24
bgneal@45 25 $(function() {
bgneal@45 26 setInterval( "slideSwitch()", 5000 );
bgneal@45 27 });