new Effect.XXX will create a new effect that is executed immediately,
regardless of where
you store the reference to it.
If you want to predefine effects for repeated reuse, you can do (from
my head, untested code!):
var myeffects = [
[Effect.Appear, 'mydiv', { duration: 2.0} ],
[Effect.Fade, 'otherdiv', { duration: 1.2} ]
];
and later do:
myeffects.each(function(effect){ new effect[0](effect[1],effect[2]) });
Note that this could probably be written in a much nicer wa.
Best,
Thomas
Am 13.12.2006 um 10:26 schrieb Javier Martinez:
> How can I store an effect into one array without execute it?
>
> When I try this, the effect executes at the same time it stores in
> the array
>
> var myarray = new Array();
> myarray.push(new Effect.Appear('midiv'));
>
> Thanks to all!
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---