Posted By

davebowker on 08/14/09


Tagged

jquery n


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

jamesming
Onfire60
acosonic


jQuery addClass every other (n)


 / Published in: jQuery
 

  1. $('.ukn-quote-wall .ukn-quote').each(function(i){
  2. var n = i % 3;
  3. $(this).addClass(
  4. n == 0 ? 'ukn-style-a' :
  5. n == 1 ? 'ukn-style-b' :
  6. n == 2 ? 'ukn-style-c' : '');
  7. });

Report this snippet  

You need to login to post a comment.