Hey,
This has been answered countless times before.
anathema a écrit :
> The goal: Fade out some content using Effect.Fade, replace that
> content with Ajax.Updater and have it Fade in. Fade out old, Fade in
> new. However, i can't seem the right combination of prototype and
> scriptaculous rules to accomplish this.
You can either use only afterFinish callbacks on effects, or queue up an
Effect.Fade and an Effect.Appear.
Something like:
var queueParam = { scope: 'outThenIn', position: 'end' };
Effect.Fade(yourElt, { duration: 0.5, queue: queueParam,
afterFinish: function() {
yourElt.update(yourNewContent);
}
});
Effect.Appear(yourElt, { duration: 0.5, queue: queueParam });
> In addition to it fading in, I would ideally like box to blinddown or
> blindup depending on if the content is more or less than the original
> content that is being replaced.
If you can actually measure the height of the former and new contents,
you can arrange that with replacing the final Effect.Appear by a
Effect.Parallel over the Appear and a BlindUp/Down, or by going manual
with an Effect.Morph.
One last thing: Fade will end up setting your element's display to none,
which will probably cause reflow; if you don't want that, replace
Fade/Appear with Opacity and manual from/to parameters (1/0 for Fade,
0/1 for Appear, which is the default).
'HTH
--
Christophe Porteneuve aka TDD
[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?hl=en
-~----------~----~----~----~------~----~------~--~---