andrew4582

applyAltRows

Nov 17th, 2011
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function applyAltRows(tableSel, evenColor, oddColor) {
  2.      $(tableSel + " tr").each(function (index) {
  3.         if (index === 0) {
  4.             return;
  5.         }
  6.         if ((index % 2 === 0)) {
  7.             if (evenColor !== null) $(this).css("background-color", evenColor);
  8.         } else {
  9.             if (oddColor !== null) $(this).css("background-color", oddColor);
  10.         }
  11.     });
  12. }
Advertisement
Add Comment
Please, Sign In to add comment