Hey Ben,
AAMOF, Effect.toggle relies on single effects, no matter what. If you
need multiple sync'd effects, you'll have to go with Effect.Parallel,
which is outside Effect.toggle's scope.
You *could* clone Effect.toggle's code for your needs, like this:
var BenEffects = {
toggle: function(element) {
element = $(element);
var options = arguments[1] || {};
var innerOptions = Object.extend(Object.extend({}, options),
{ sync: true });
var index = element.visible() ? 1 : 0;
var effect1 = new Effect[Effect.PAIRS['appear'][index]](element,
innerOptions);
var effect2 = new Effect[Effect.PAIRS['blind'][index]](element,
innerOptions);
new Effect.Parallel([effect1, effect2], options);
}
}
Then use:
BenEffects.toggle('eltId');
Tested. Works :-)
--
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
-~----------~----~----~----~------~----~------~--~---