Is it possible to hide a few divs and show one all in one call ? <a href="#" onclick="Element.hide(''canbackground'',''canposition'', ''canskill'')", Element.show (''basicinfo''); well I had something like this but it was working very screwey. Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Dark Ambient wrote:> Is it possible to hide a few divs and show one all in one call ? > > <a href="#" onclick="Element.hide(''canbackground'',''canposition'', > ''canskill'')", > Element.show(''basicinfo''); > well I had something like this but it was working very screwey.That should work. The need to hide and show elements like that is very common for me, and I actually do it with a function: function showHide(showElements,hideElements) { showElements.each(Element.show); hideElements.each(Element.hide); } <a href="#" onclick=" showHide([''canbackground'',''canposition'',''canskill''],[''basicinfo'']) "> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 11/29/06, Ken Snyder <ksnyder-evSXmdsRj0TQT0dZR+AlfA@public.gmane.org> wrote:> > > Dark Ambient wrote: > > Is it possible to hide a few divs and show one all in one call ? > > > > <a href="#" onclick="Element.hide(''canbackground'',''canposition'', > > ''canskill'')", > > Element.show(''basicinfo''); > > well I had something like this but it was working very screwey. > That should work. > The need to hide and show elements like that is very common for me, and > I actually do it with a function: > > function showHide(showElements,hideElements) { > showElements.each(Element.show); > hideElements.each(Element.hide); > } > > <a href="#" onclick=" > showHide([''canbackground'',''canposition'',''canskill''],[''basicinfo'']) > ">Perfect ! Thank you. I think all the shows and hides was making the page crazy. 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 -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ken Snyder wrote:> Dark Ambient wrote: >> Is it possible to hide a few divs and show one all in one call ? >> >> <a href="#" onclick="Element.hide(''canbackground'',''canposition'', >> ''canskill'')", >> Element.show(''basicinfo''); >> well I had something like this but it was working very screwey. > That should work.Not anymore. Quoting r4881 commit log message: "For consistency, Element.toggle, Element.show, and Element.hide no longer take an arbitrary number of arguments" Anyway, it can be chained like this: $(''canbackground'',''canposition'',''canskill'').invoke(''hide'') - -- Marius Feraru -----BEGIN PGP SIGNATURE----- iD8DBQFFbgq+tZHp/AYZiNkRAheZAKDNdLTuQMnQWBUVEtnznqNiZ7q6IACgyFL7 o7eRrF8zKqZ+H42Jk75ogwo=6reT -----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 -~----------~----~----~----~------~----~------~--~---