Hi everybody,

I have this loop that loops through the the number of pictures to be
in a slide show. Too handle when a photo should appear and when it
should disappear I'm using the PeriodicalExecuter.

Heres the code:

   var photo = null;
   for (var i=0;i<loop_length;i++) {
       if (i == 0) {
           var exe_time = 1;
       } else {
           var exe_time = (i * 8);
       }

       photo = 'photo'+i;

       new PeriodicalExecuter(
           function(pe) {
               pe.stop();
               $(photo).setStyle({display: 'block'});
               new Effect.Opacity(photo, {duration:1.0, from:0.0, to:
1.0, afterFinish: end_show});
               function end_show() {
                   new Effect.Opacity(photo, {delay:4.0, duration:1.0,
from:1.0, to:0.0, afterFinish: function() {$(photo).setStyle({display:
'none'})}});
               }
           }, exe_time);

   }


I'm wondering if you can have more than one PeriodicalExecuter?

Thanks for any help


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to