grifdail

bejeweld

Nov 14th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.onload = function(event)
  2. {
  3.  var Gcarre = document.getElementById("Gcarre");
  4.  var RandomBlobz;
  5.  
  6.      for (i=0; i<64; i++)
  7.      { //Peut etre utilisé une fonction createCarre(i); ?
  8.       var Pcarre = document.createElement("div");
  9.      
  10.       Pcarre.id = i;
  11.         Pcarre.className = "CarreGros";
  12.         RandomBlobz = BlobzyRandom();
  13.         Pcarre.style.backgroundImage = "url(" + RandomBlobz +")";
  14.  
  15.       Gcarre.appendChild(Pcarre);
  16.     }
  17. }
  18.  
  19. function BlobzyRandom ()
  20. {
  21.  
  22.   var Blobz = new Array("Bluzy.png","Greezy.png","Redzy.png","Yellzy.png","Zygrey.png");
  23.   var RandomBlobz = Blobz[Math.floor(Math.random()*Blobz.length)];
  24.  
  25.   return RandomBlobz;
  26. }
  27.  
  28. function Switch() //quelle parametre lui passé ?
  29. {
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment