Advertisement
gilmarpalega

Java Script Challenge: Make me Blue

May 29th, 2014
713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 2
  2. $('.wants-to-be-blue').blue();
  3.  
  4.  
  5. 3
  6.     $( "li" ).each(function( index ) {
  7.       var comm = $(this).html();
  8.       if (comm.length > 0) $( this ).blue();
  9.     });
  10.  
  11.  
  12. 4
  13.     $( "div, span, i" ).each(function( index ) {
  14.       var comm = $(this).html().trim();
  15.       if (comm.indexOf('<!-- Make me blue! -->')==0) $( this ).blue();
  16.     });
  17.  
  18. 5
  19.     $( "div" ).each(function( index ) {
  20.         i = index+1;
  21.         $( "div" ).each(function( index ) {
  22.             var comm = $(this).html();
  23.        
  24.             if (comm == i) $( this ).blue();
  25.         });
  26.     });
  27.  
  28.  
  29. 6
  30. $('div:not(.bomb)').blue();
  31.  
  32.  
  33. 7
  34. setTimeout(function(){
  35.     $('div').blue();
  36. }, 1100);
  37.  
  38. 8
  39. $('button').click();
  40. $('div').blue();
  41.  
  42.  
  43. 9
  44. targets = $('#map').text();
  45. myids = targets.split(' ');
  46.  
  47. hahaha = '#'+ myids.slice(0, 5).join(', #');
  48.  
  49. $(hahaha).blue();
  50.  
  51.  
  52. 10
  53. setTimeout(valarmorghulis, 10);
  54.  
  55. function valarmorghulis() {
  56.     $( "div" ).each(function( index ) {
  57.         var comm = $(this).hasClass('bomb');
  58.         if ( !comm) {
  59.             $( this ).blue();
  60.         }
  61.        
  62.     });
  63.  
  64.     setTimeout(valarmorghulis, 500);
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement