Trying to create alternating colored rows on table

0 views
Skip to first unread message

delaysla

unread,
Aug 9, 2009, 10:40:25 PM8/9/09
to chainjs
Hello;

I am new to discussion groups. So am hoping this question is
appropriate.

I am trying to create a table with alternating rows of different
colors using the chain.js library.

The table gets created fine, but I don't know enough about javascript
to figure out how to change the row's attributes

Any help would be appreciated. or just pointing be to some basic
reference material would be great.

rizqi

unread,
Aug 10, 2009, 2:35:26 PM8/10/09
to chainjs
hi,

try this:

<div id="chain">
<div class="odd">row</div>
</div>

$('#chain').items(...).chain(function(){

if(this.hasClass('odd'))
this.removeClass('odd').addClass('even');
});

david de la ysla

unread,
Aug 11, 2009, 9:46:11 AM8/11/09
to cha...@googlegroups.com
thanks so very much this is very helpful. I am just getting started using your chain function and it seems very good.
Reply all
Reply to author
Forward
0 new messages