Hi Justin,
That is really compact code, thanks for the example!

BTW: In documentation, $$ still state GetElementByClassName as
alternative, even if it's now depricated?

/Bjorn


On Jan 17, 12:18 am, "Justin Perkins" <[EMAIL PROTECTED]> wrote:
> On Jan 16, 2008 4:43 PM, Bjørn <[EMAIL PROTECTED]> wrote:
>
>
>
> > Just a quick one, bear with me as I'm a prototype nOOb...:-)
> > The following code works in firefox, but IE7 complain that it cannot
> > get the display property?
> > -----------------------------------------------
> > var elms = $('sort_container').getElementsByClassName('grouped_'+idx);
> > for(var i=0; i<elms.length; i++){
> >     elms[i].style.display = "none"
> > }
> > -----------------------------------------------
>
> If you're using the latest version of prototype (1.6.0.x), then you
> should update that code a wee bit to use the select() method instead
> of getElementsByClassName(). Here is a prototype-ized version of your
> code:
>
> $$('#sort_container grouped_' + idx).invoke('hide');
>
> Or...
>
> $('sort_container').select('grouped_' + idx).invoke('hide');
>
> Have a great day.
>
> -justin
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to