Posted By


benatkin on 04/07/08

Tagged


Statistics


Viewed 93 times
Favorited by 0 user(s)

Highlight table cells


/ Published in: JavaScript
Save to your folder(s)

requires jquery


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.