Posted By

benatkin on 04/07/08


Tagged


Versions (?)

Highlight table cells


 / Published in: JavaScript
 

requires jquery

  1. $('td').css('border', '2px dotted orange');
  2.  
  3. function hilite(sel, i, count) {
  4. if (i < count) {
  5. if (i > 0) sel.eq(i - 1).css('border', '2px dotted orange');
  6. sel.eq(i).css('border', '2px solid blue');
  7. setTimeout(function() { hilite(sel, i + 1, count) }, 50);
  8. }
  9. }
  10.  
  11. tds = $('td');
  12. hilite(tds, 0, tds.size());

Report this snippet  

You need to login to post a comment.