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: [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to