Hi Eric,

you should know that Effect.Morph accept a class as "style" input.
So let's try something like that:

$$(".foo").each( function (item) {
  new Effect.Morph(item, {
    style: 'error', // CSS class name
  });
});

But talking about performance, I'm not sure it's the best way to do
it !

--
david

On 9 fév, 18:48, Eric <lefauv...@gmail.com> wrote:
> Hi bminihan,
>
> On Feb 9, 3:59 pm, bminihan <bjmini...@gmail.com> wrote:
>
> > Why not just switch all of your elements to a different class, with
> > the new effect?
>
> > .FOO { opacity: 1.0 }
> > .BAR { opacity: .9 }
>
> > $$(".foo").each( function (item) { item.className = "BAR"; })
>
> Well, changing 300 times a class would take about the same time that
> changing 300 times the opacity (even more since you have to remove the
> previous one).
> Moreover, I am looking for "smooth" transition. I don't think there is
> an effect that allow iterating a collection of classNames and setting
> it to the objects one after another (but this could give some
> interesting effects :o) ).
>
> The interest here is to change a single variable and impact hundreds
> (thousands?) of DOM objects in an eye blink.
>
> Eric
>
> NB: BTW, since classNames is a collection, you may not affect it this
> way but instead use Element.addClassName() and Element.removeClassName
> ().
--~--~---------~--~----~------------~-------~--~----~
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-scriptaculous@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to