Is it possible to create effects on elements with that classname instead of by id? with scriptaculous. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Mech7 a écrit :> Is it possible to create effects on elements with that classname > instead of by id? with scriptaculous.Er… Instead of: new Effect.Blah(''id'', options); You could go: $$(''.yourClassName'').each(function(element) { new Effect.Blah(element, options); }); Or if the effect has a builtin method for it (say, Fade): $$(''.yourClassName'').invoke(''blah'', options); -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I see... but why wont it work if i do something like:
Element.insert(element,{ after: error });
new Effect.BlindDown(error);
Is there a way to insert element with an effect before they exist?
On May 4, 9:47 pm, Christophe Porteneuve
<t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org>
wrote:> Mech7 a écrit :
>
> > Is it possible to create effects on elements with that classname
> > instead of by id? with scriptaculous.
>
> Er…
>
> Instead of:
>
> new Effect.Blah(''id'', options);
>
> You could go:
>
> $$(''.yourClassName'').each(function(element) {
> new Effect.Blah(element, options);
> });
>
> Or if the effect has a builtin method for it (say, Fade):
>
> $$(''.yourClassName'').invoke(''blah'',
options);
>
> --
> Christophe Porteneuve aka TDD
> t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Correct way to write is
element.insert({ after: error });
new Effect.BlindDown(error);
>Is there a way to insert element with an effect before they exist?
Have u tried to make error invisible before creating effect?
On May 5, 3:46 am, Mech7
<chris.de....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I see... but why wont it work if i do something like:
>
> Element.insert(element,{ after: error });
> new Effect.BlindDown(error);
>
> Is there a way to insert element with an effect before they exist?
>
> On May 4, 9:47 pm, Christophe Porteneuve
<t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:
>
> > Mech7 a écrit :
>
> > > Is it possible to create effects on elements with that classname
> > > instead of by id? with scriptaculous.
>
> > Er…
>
> > Instead of:
>
> > new Effect.Blah(''id'', options);
>
> > You could go:
>
> > $$(''.yourClassName'').each(function(element) {
> > new Effect.Blah(element, options);
> > });
>
> > Or if the effect has a builtin method for it (say, Fade):
>
> >
$$(''.yourClassName'').invoke(''blah'',
options);
>
> > --
> > Christophe Porteneuve aka TDD
> > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
woops your right works a charm :D On May 5, 1:02 am, Rauan Maemirov <rauan1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Correct way to write is > > element.insert({ after: error }); > new Effect.BlindDown(error); > > >Is there a way to insert element with an effect before they exist? > > Have u tried to make error invisible before creating effect? > > On May 5, 3:46 am, Mech7 <chris.de....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I see... but why wont it work if i do something like: > > > Element.insert(element,{ after: error }); > > new Effect.BlindDown(error); > > > Is there a way to insert element with an effect before they exist? > > > On May 4, 9:47 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote: > > > > Mech7 a écrit : > > > > > Is it possible to create effects on elements with that classname > > > > instead of by id? with scriptaculous. > > > > Er… > > > > Instead of: > > > > new Effect.Blah(''id'', options); > > > > You could go: > > > > $$(''.yourClassName'').each(function(element) { > > > new Effect.Blah(element, options); > > > }); > > > > Or if the effect has a builtin method for it (say, Fade): > > > > $$(''.yourClassName'').invoke(''blah'', options); > > > > -- > > > Christophe Porteneuve aka TDD > > > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---