Is it possible to apply two visual_effect to the same DOM ID? I can get it to work like this: page[:current_item].visual_effect :highlight, :start_color => "#fff", :end_color => "#000" page[:current_item].visual_effect :puff But can I call it like this: page[:current_item].visual_effect :EFFECT1, :EFFECT2 Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
most likely not a good idea. i had some problems doing things like that, because starting an effect stops the first one and leaves the item in some intermediate state. seems, there can be only one active effect at all. (maybe that''s fixed in newer versions, i didn''t try this for quite some time now) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
If you want to run multiple sequential effects, use this rarely documented option: visual_effect(:highlight, "posts", :duration => 0.5, :queue=>''end'') If you want to run multiple effects simultaneously, you need to subclass an effect in the scriptaculous library and combine them programatically. On Apr 28, 4:32 pm, RoRNoob <rorn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Is it possible to apply two visual_effect to the same DOM ID? > > I can get it to work like this: > > page[:current_item].visual_effect :highlight, :start_color => > "#fff", :end_color => "#000" > page[:current_item].visual_effect :puff > > But can I call it like this: > > page[:current_item].visual_effect :EFFECT1, :EFFECT2 > > Thanks!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks - I will give that a shot. On Apr 29, 7:20 am, Clever Neologism <gest...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If you want to run multiple sequential effects, use this rarely > documented option: > > visual_effect(:highlight, "posts", :duration => 0.5, :queue=>''end'') > > If you want to run multiple effects simultaneously, you need to > subclass an effect in the scriptaculous library and combine them > programatically. > > On Apr 28, 4:32 pm, RoRNoob <rorn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Is it possible to apply two visual_effect to the same DOM ID? > > > I can get it to work like this: > > > page[:current_item].visual_effect :highlight, :start_color => > > "#fff", :end_color => "#000" > > page[:current_item].visual_effect :puff > > > But can I call it like this: > > > page[:current_item].visual_effect :EFFECT1, :EFFECT2 > > > Thanks!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Clever Neologism wrote:> If you want to run multiple sequential effects, use this rarely > documented option: > > visual_effect(:highlight, "posts", :duration => 0.5, :queue=>''end'')How would that work? How can I have two visual effects when something is clicked? <%= content_tag ''div'', truncate(@linklog.notes, 40, "..."), :id => "initial#{@linklog.id}", :onclick => visual_effect(:toggle_blind, "link_body#{@linklog.id}", :duration => 1.0, :queue=>''end'') %> -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 10 Jul 2008, at 18:07, Joe Peck wrote:> > Clever Neologism wrote: >> If you want to run multiple sequential effects, use this rarely >> documented option: >> >> visual_effect(:highlight, "posts", :duration => 0.5, :queue=>''end'') > > How would that work? How can I have two visual effects when something > is clicked? >There are two separate issues here: whether effects run in parallel, sequentially etc and then the business of actually creating an effect> <%= content_tag ''div'', truncate(@linklog.notes, 40, "..."), :id => > "initial#{@linklog.id}", :onclick => visual_effect(:toggle_blind, > "link_body#{@linklog.id}", :duration => 1.0, :queue=>''end'') %>The rails javascript helpers can be handy but it''s important to understand what they do. visual_effect(...) just spits out new Effect.Something($ (''some_id''), ...) so if you want 2 effects created then visual_effect(...) + '';'' + visual_effect(...) will do the job. You will need to look into the queue options (or effect.parallel in friends) if you want to play around with which one happens first, whether they run sequentially or not etc... Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> > The rails javascript helpers can be handy but it''s important to > understand what they do. > visual_effect(...) just spits out new Effect.Something($ > (''some_id''), ...) > > so if you want 2 effects created then visual_effect(...) + '';'' + > visual_effect(...) will do the job. > > FredThanks, that was the exact answer I was looking for :) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---