I posted earlier about this but think google groups was screwed up. Anyway, I''m trying to get multiple elements to hide and it doesn''t appear to be working correctly. <a href="#" onclick="Element.hide(''basicinfo'', ''canposition'',''canskill''); return false;"> I''ve tried a few variations and none seem to work correctly. At one point I had ''display: none; which helped, but the above code is one of 4 tabs.. It seemed when I got to 3 and 4 things got screwed up with elements not hiding and multiple divs showing up. TIA Stuart --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
See my erlier reply today on how to make your local code work with multiple arguments. The multiple argument support is removed in the latest prototype version so you should use this style instead: [''element1'', ''element2'', ''elemen3''].each(Element.hide); On 11/28/06, sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I posted earlier about this but think google groups was screwed up. > > Anyway, I''m trying to get multiple elements to hide and it doesn''t > appear to be working correctly. > > <a href="#" onclick="Element.hide(''basicinfo'', > ''canposition'',''canskill''); return false;"> > > I''ve tried a few variations and none seem to work correctly. At one > point I had ''display: none; > which helped, but the above code is one of 4 tabs.. It seemed when I > got to 3 and 4 things got screwed up with elements not hiding and > multiple divs showing up. > > TIA > Stuart > > > > >-- burnfield.com/martin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Note that the reason for removal of support for this is that the Element methods return the element for chaining methods. If you prefer, you can have your own little helper method for this (untested code!): function hideElements(){ $A(arguments).each(Element.hide); } then you can use: <a href="#" onclick="hideElements(''basicinfo'', ''canposition'',''canskill''); return false;"> Personally, I prefer calling the .each construct directly, as in Martin''s reply. best, Thomas Am 03.12.2006 um 15:19 schrieb Martin Ström:> > See my erlier reply today on how to make your local code work with > multiple arguments. The multiple argument support is removed in the > latest prototype version so you should use this style instead: > > [''element1'', ''element2'', ''elemen3''].each(Element.hide); > > On 11/28/06, sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> I posted earlier about this but think google groups was screwed up. >> >> Anyway, I''m trying to get multiple elements to hide and it doesn''t >> appear to be working correctly. >> >> <a href="#" onclick="Element.hide(''basicinfo'', >> ''canposition'',''canskill''); return false;"> >> >> I''ve tried a few variations and none seem to work correctly. At one >> point I had ''display: none; >> which helped, but the above code is one of 4 tabs.. It seemed when I >> got to 3 and 4 things got screwed up with elements not hiding and >> multiple divs showing up. >> >> TIA >> Stuart >> >> >>> >> > > > -- > burnfield.com/martin > > >-- Thomas Fuchs wollzelle http://www.wollzelle.com questentier on AIM madrobby on irc.freenode.net http://www.fluxiom.com :: online digital asset management http://script.aculo.us :: Web 2.0 JavaScript http://mir.aculo.us :: Where no web developer has gone before --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thomas Fuchs wrote:> function hideElements(){ > $A(arguments).each(Element.hide); > }Ugly :)) Let''s not forget that "$()" accepts multiple arguments: $(''e1'', ''e2'', ''e3'').each(Element.hide); "$$()" could also be used for that _when_ it will be able to parse things like "#a, #b, #c": $$(''#e1, #e2, e3'').each(Element.hide);> Personally, I prefer calling the .each construct directly, as in > Martin''s reply."function(){}" it''s already to long for our sweety-pie. We have "invoke" as a more concise sweetener. ;-) Even more - for our specific context - directly invoking "class" methods (OK, triple quotes should be used :))) should become deprecated at some point, as this is getting uglier every day (Element vs Element.Methods). So, let''s "invoke": $(''e1'', ''e2'', ''e3'').invoke(''hide''); Currently, my preferred way to doing things like this is: $(qw(''e1 e2 e3'')).invoke(''hide''); ("qw" is like Perl''s string to array sweetener) Maybe I''ll switch to: $$(''#e1, #e2, #e3'').invoke(''hide''); when it becomes generally available. ;-)> Am 03.12.2006 um 15:19 schrieb Martin Ström: >> [''element1'', ''element2'', ''elemen3''].each(Element.hide); >> >> On 11/28/06, sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> I posted earlier about this but think google groups was screwed up.Google Groups works after all, even if sometimes has huge delay and makes discussions go crazy (remember the "old messages "storm" a week ago or so) ;-) cheers - -- Marius Feraru -----BEGIN PGP SIGNATURE----- iD8DBQFFdvf5tZHp/AYZiNkRAkKwAJ926bKRFnN0WPJhnjSwRCwvh/KP/wCgoc7D UqEE2FoY8eVgamfslDe5ebs=jdQZ -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Marius Feraru wrote:> Currently, my preferred way to doing things like this is: > $(qw(''e1 e2 e3'')).invoke(''hide''); > > ("qw" is like Perl''s string to array sweetener)Sweet! Is Prototype getting qw() ? I was wishing I had that just a few hours ago :) -- Michael Peters Developer Plus Three, LP --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Michael Peters a écrit : > Sweet! Is Prototype getting qw() ? I was wishing I had that just a few hours ago :) It has $w now :-) -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: 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 -~----------~----~----~----~------~----~------~--~---
Yes it will work in the same way but be called $w instead (like ruby''s %w dito) It was checked into prototype svn a couple of days ago: http://dev.rubyonrails.org/changeset/5679 Martin On 12/6/06, Michael Peters <mpeters-aUYv5hkjw45l57MIdRCFDg@public.gmane.org> wrote:> > > > Marius Feraru wrote: > > > Currently, my preferred way to doing things like this is: > > $(qw(''e1 e2 e3'')).invoke(''hide''); > > > > ("qw" is like Perl''s string to array sweetener) > > Sweet! Is Prototype getting qw() ? I was wishing I had that just a few hours ago :) > > -- > Michael Peters > Developer > Plus Three, LP > > > > >-- burnfield.com/martin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---