Hi, > Yes they do. I'm using Script.aculo.us but i have to start multiple > animations (i.e. fadeouts) on multiple elements, so its a bit tricky > to use the afterFinish functions because it would get called after > every finish of every element.
Ah. I'm not a scripty-head, but I wonder if the Parallel effect would help: http://wiki.github.com/madrobby/scriptaculous/effect-parallel > "Rick Waldron" <waldron.r...@gmail.com> wrote on 07.12.2009 15:10:19: > > > I'm not at a computer to try this out, and well, it might be a > > little hair-brained but perhaps... > > > ( new Ajax.Updater() ).defer(); > > Nice idea. But it does not work :-/ Indeed not, all that does is create the Ajax.Updater object (which starts the update) and then try to call a #defer function on the returned Ajax.Updater instance -- which isn't a function and doesn't have a #defer function. I'm still not seeing why wrapping up the call in a function is a problem. It seems like a simple and straightforward solution, if you can't use an `afterFinish` callback (which is, of course, also a function). FWIW, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On Dec 7, 8:56 pm, "David S." <evil.zweitaus...@googlemail.com> wrote: > "T.J. Crowder" <t...@crowdersoftware.com> wrote on 12.07.2009 09:38:54 > AM: > > > Hi, > > > Your animations don't provide an `afterFinish` callback or similar? > > Yes they do. I'm using Script.aculo.us but i have to start multiple > animations (i.e. fadeouts) on multiple elements, so its a bit tricky > to use the afterFinish functions because it would get called after > every finish of every element. > > Here's the piece of code: > > var teaser_select = function (t) { > > var t_id = t.identify(); > > t.absolutize(); // Use before offset calculation! > > var moveby_y = t.cumulativeOffset().top; > > moveby_y -= ($('mv_logo').cumulativeOffset().top + $ > ('mv_logo').getHeight()); > > moveby_y *= -1; > > new Effect.Move(t,{ duration: 0.5, x: 0, y: moveby_y, mode: > 'relative' }); > > // Fade out all teasers from bottom to top > > $$('.teaser').reverse().each(function (teaser) { > > if (teaser.identify() == t_id) return; > > teaser.fade({ duration: 0.5, from: 1, to: 0 }); > > }); > > // TODO: > > // Call ajax after all teasers have been hidden > > } > > Maybe there's a simpler way to fade out more than one element at once > and the each(...)-iteration becomes needless. Or its possible to call > one function after many effects have been finished. > > But how? > > "Rick Waldron" <waldron.r...@gmail.com> wrote on 07.12.2009 15:10:19: > > > I'm not at a computer to try this out, and well, it might be a > > little hair-brained but perhaps... > > > ( new Ajax.Updater() ).defer(); > > Nice idea. But it does not work :-/ > > David. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.