Mercurial > public > sg101
annotate media/js/slideshow.js @ 184:4e1abeb593c2
Updating jQuery and jQuery UI. This is for ticket #57. Noticed GCalendar wasn't opening the datepicker on the correct date until I set a dateFormat option. Fixed member map to undisable the update button if you type in a location that can't be geocoded.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 28 Mar 2010 22:19:08 +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 }); |