[Rails] RJS Change Background Color
Zack Chandler
zackchandler at gmail.com
Tue Aug 8 22:28:23 GMT 2006
Try this:
page.call 'Element.addClassName', 'element_id', 'class_name'
Zack
On 8/8/06, David R. <lists.david at gmail.com> wrote:
> Thanks for the answer, Zack.
>
> I'm not sure quite how to use that method, though. Fitting
> Element.addClassName into an RJS file won't work, and page.add_class_name
> "id of element", "class name" throws an error saying AddClassName is not
> defined.
>
> - David
>
>
> On 8/7/06, Zack Chandler <zackchandler at gmail.com> wrote:
> > David,
> >
> > Use Element.addClassName(element, className) and CSS.
> >
> > Hope this helps,
> > Zack
> >
> > On 8/7/06, David R. <lists.david at gmail.com> wrote:
> > > What's the page.method to change the background color of a DOM element?
> I'm
> > > trying to change the background color of a couple of styled <li>'s when
> an
> > > Ajax link is clicked.
> > >
> > > Thanks,
> > > David
> > >
> > > _______________________________________________
> > > Rails mailing list
> > > Rails at lists.rubyonrails.org
> > > http://lists.rubyonrails.org/mailman/listinfo/rails
> > >
> > >
> > >
> > _______________________________________________
> > Rails mailing list
> > Rails at lists.rubyonrails.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails
> >
>
>
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>
More information about the Rails
mailing list