views:

21

answers:

2

I have an application, that uses scriptaculous' effects queue to render the view of a game. Ajax-requests read events from a server, from these events, effects are generated and enqueued.

Some events have nothing to animate, only code to execute. It is possible, by creating a Dummy-effect, and use the afterFinish option.

Is there a better way?

A: 

Yes, You can write your own effect class and take advantage of all kinds of Scriptaculous/Prototype goodness.

Here is an example I wrote.

Diodeus
The effect i wrote basically boils down to a DummyEffect, because all i need in this case is the afterFinish-callback.But I take from your answer that there is now better way that to write own effects, even if they don't do much.Thanks!
keppla
A: 

There seems to be an undocumented Effect-class which is basically my dummy class: Effect.Event(options), which is used internally by scriptaculous. For my purpose (just enqueueing a function) it does the Job.

keppla