Bah T.J!

You beat me to it!

:-)

On Tue, Aug 31, 2010 at 4:39 PM, T.J. Crowder <t...@crowdersoftware.com>wrote:

> Hi,
>
> Hope you enjoy Prototype!
>
> The Prototype equivalent of jQuery's `$` function is `$$` (yes,
> really):
> http://api.prototypejs.org/language/dollardollar/
>
> The Prototype equivalent of jQuery's `css` function is `setStyle`:
> http://api.prototypejs.org/dom/element/setstyle/
>
> Prototype doesn't conflate the concepts of elements and lists of
> elements like jQuery does, and so `setStyle` is for operating on a
> single element, not a list of them. However, Prototype provides the
> `invoke` function on arrays and other enumerable things to let you
> call the same function on each item in the array:
> http://api.prototypejs.org/language/enumerable/prototype/invoke/
>
> So basically (assuming Prototype supports those CSS selectors, and I
> think it does -- esp. if you use 1.7 and plug in the Sizzle engine,
> which is what jQuery uses):
> * * * *
> $$("td:contains('Pendiente')").invoke("setStyle", "background",
> "#c00");
> $$("td:contains('Procesando')").invoke("setStyle", "background",
> "#0c0");
> $$("td:contains('Completo')").invoke("setStyle", "background",
> "#000");
> * * * *
>
> If you're new to Prototype, it's __well worth__ your time to sit down
> and read the API from beginning to end. It takes about 1-2 hours, and
> will save you a lot more than that much time within the first couple
> of weeks of use. Really 1-2 hours, I'm not joshing you. :-)
> http://api.prototypejs.org
>
> The "learn" page on the site is also useful, although frankly a bit
> dated. There's also an unofficial wiki:
> http://prototypejs.org/learn
> http://proto-scripty.wikidot.com
>
> HTH,
> --
> T.J. Crowder
> Independent Software Consultant
> tj / crowder software / com
> www.crowdersoftware.com
>
> On Aug 31, 2:39 pm, VEO creativos <veocreati...@gmail.com> wrote:
> > Hi! I'm trying to assign a CSS style to a TR that contains the words
> > "Pendiente", "Procesando" and "Completo".
> > I've made this for jQuery, but I need to do it with prototype/
> > scriptaculous and I'm a totally newbie.
> >
> > Thanks in advance for any help!
> >
> > This is the code I've made for jQuery:
> > <script>
> >   $("td:contains('Pendiente')").css("background", "#c00");
> >   $("td:contains('Procesando')").css("background", "#0c0");
> >   $("td:contains('Completo')").css("background", "#000");
> > </script>
> >
> > Thanks!!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To post to this group, send email to
> prototype-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com<prototype-scriptaculous%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to