Mercurial > public > sg101
annotate media/js/slideshow.js @ 197:2baadae33f2e
Got autocomplete working for the member search. Updated django and ran into a bug where url tags with comma separated kwargs starting consuming tons of CPU throughput. The work-around is to cut over to using spaces between arguments. This is now allowed to be consistent with other tags. Did some query optimization for the news app.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 10 Apr 2010 04:32:24 +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 }); |