Advertisement
schrodervictor

Victor Schröder's solution: Challenge 10

Jun 6th, 2014
566
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var delay = 60,
  2.     position = 0,
  3.     divs = $('div');
  4.  
  5. setTimeout(makeBlue, delay);
  6.  
  7. function makeBlue(){
  8.     divs.eq(position).blue();
  9.     divs.eq(position + 5).blue();
  10.         setTimeout(function(){
  11.             position++;
  12.             if(position >= divs.length){
  13.                 position = 0;
  14.             }
  15.             setTimeout(makeBlue, 500);
  16.         }, 100);
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement