I''ve run into an issue. Running Effect.Grow (for instance) to cancel out Effect.Shrink makes elements forget their original size, etc. I''ve looked unsuccessfully a bit for a way to halt further progression of an effect so that I can simply put on the brakes and reverse the transition, whatever the effect is. Any help would be appreciated. I have a page where I''m demoing effects for my company and here''s how it works: A set of checkboxes on one side toggle the results of a search page on and off depending on various selectors (brand, model of product, etc) and the effects run fine if you let the initiated effect finish. i.e., if I run Effect.Shrink on a container, it and its contents shrink away as expected, etc. However, if this effect is "interrupted" by another effect call, all of its originalX info gets messed with by the new effect. What is the best way to halt progression and backpedal an effect in this way? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Mar-23 09:20 UTC
Re: Element forgets original size if Effect interrupted
Hey there, OK, first, there''s the question of whether you need to pull the brakes on a running effect, or just run a symetrical effect once your first one is done with. In the latter case, it should work alright, as most effects restore the element''s original styling (or lack thereof) upon completion, usually in their afterFinishInternal callback. So for instance: new Effect.Shrink(''id''); new Effect.Grow(''id'', { queue: ''end'' }); will work like a charm. Now, if you need to stop an effect cold, and still have it restore original styling, you need to keep a reference on the effect object, then trick it into believing it''s done: var shrinker = new Effect.Shrink(''id''); // some code, then trick the effect into believing it''s done: shrinker.loop(shrinker.finishOn); This uses a rather "private" part of the effects API, but I think you''re safe as maintenance goes... -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the response! Will look into it. However, another wrinkle is that I''m looping through all the boxes with given classes to run the effect on, and optimally running the effect simultaneously (or close to it) would be best. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Mar-23 21:08 UTC
Re: Element forgets original size if Effect interrupted
thynctank a écrit :> Thanks for the response! Will look into it. However, another wrinkle > is that I''m looping through all the boxes with given classes to run > the effect on, and optimally running the effect simultaneously (or > close to it) would be best.How is that impossible ? Using "new Effect" with the default queue mode (''parallel'') triggers them ASAP... -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Strange that messages from Google Groups propagate to the other list but not the other way around. Sorry just noticing. It''s an annoyance. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---