Advertisement
BigRob154

tutorialzine js challenge make me blue

Jun 6th, 2014
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // #1
  2. $('#me').blue();
  3.  
  4. // #2
  5. $('.wants-to-be-blue').blue();
  6.  
  7. // #3
  8. $('ul li:nth-child(4)').blue();
  9.  
  10. // #4
  11. $('*').contents().filter(function(){
  12.     return this.nodeType == 8;
  13. }).each(function(i, e){
  14.     if (e.nodeValue && e.nodeValue.indexOf('Make me blue') !== -1) {
  15.         $(e.parentNode).blue();
  16.     }
  17. });
  18.  
  19. // #5
  20. var orders = [8, 2, 9, 6, 4, 1, 3, 7, 5];
  21. for (var i = 0; i < orders.length; i++){
  22.     $('div:nth-child('+orders[i]+')').blue();
  23. }
  24.  
  25. // #6
  26. $('div').not('.bomb').blue();
  27.  
  28. // #7
  29. setTimeout(function() {
  30.     $('section div').blue();
  31. }, 1100);
  32.  
  33. // #8
  34. $('button').click();
  35. setTimeout(function() {
  36.     $('div').blue();
  37. }, 20);
  38.  
  39. // #9
  40. var myIds = $('#map')[0].textContent.split(' ');
  41. myIds.forEach(function(item) {
  42.     $('#' + item).blue();
  43. });
  44.  
  45. // #10
  46. setInterval(function() {
  47.     $('div').not('.bomb').blue();
  48. }, 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement