Hi to all, I''m very new to either Ruby and scriptaculous. I''ve just tried using Effect.puff(), and it puffs towards the North-West (or 10 O''Clock). Is it possible to control the direction where the element should puff to? Thank you in advance. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2006-Oct-10 20:04 UTC
Re: Effect.puff() ... how to control where it puffs away?
darkmatter a écrit :> Hi to all, > > I''m very new to either Ruby and scriptaculous. I''ve just tried using > Effect.puff(), and it puffs towards the North-West (or 10 O''Clock). Is > it possible to control the direction where the element should puff to?Actually, Puff doesn''t puff towards the NW: it scales "from center" outwards. You might get the impression it puffs NW-wise if you puff an element that is not absolutely positioned prior to effect: "absolutizing" it on the fly may result in a vague sense of movement. At any rate, you can control the scaling the same way you control it in Effect.Scale (as Puff is a synchronized execution of Scale and Opacity): through the options scaleX, scaleY and scaleFromCenter. If you look for a specific direction, you might want to clone the Effect.Puff code and make it use Effect.Grow internally, instead of Effect.Scale. Effect.Grow provides a ''direction'' option that supports four diagonal directions + ''center''. But before you embark on all this, ask yourself: do you *really* need to control puff direction? Its default mode (scale from center) is pretty good for just about all needs. We''re talking about an element that won''t even be /visible/ in the end, and usually puffs out over a short period of time (default duration is 1.0 sec., for instance). -- 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 -~----------~----~----~----~------~----~------~--~---
darkmatter
2006-Oct-11 03:40 UTC
Re: Effect.puff() ... how to control where it puffs away?
Hi Christophe, Thanks for your reply. I''ll surely take your advise on cloning/merging Effect.Puff with Effect.Grow and Effect.Scale :D As for your question, I may need the Puff-ed element re-appear again from the last place it was dissappearing. But, that''ll be in the long run. Thanks again. Cheers, Darkmatter Christophe Porteneuve wrote:> ...... > At any rate, you can control the scaling the same way you control it in > Effect.Scale (as Puff is a synchronized execution of Scale and Opacity): > through the options scaleX, scaleY and scaleFromCenter. > > If you look for a specific direction, you might want to clone the > Effect.Puff code and make it use Effect.Grow internally, instead of > Effect.Scale. Effect.Grow provides a ''direction'' option that supports > four diagonal directions + ''center''. > > But before you embark on all this, ask yourself: do you *really* need to > control puff direction? Its default mode (scale from center) is pretty > good for just about all needs. We''re talking about an element that > won''t even be /visible/ in the end, and usually puffs out over a short > period of time (default duration is 1.0 sec., for instance). > ......--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---