Advertisement
DraKiNs

[JS] Random Background

Sep 15th, 2011
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <body   style="background-color:yellow" />
  2. <div id="cores" />
  3.  
  4.  
  5.  
  6.  
  7. <script>
  8.  
  9. var i = document.body.clientWidth   - 1;
  10. var a = document.body.clientHeight - 1;
  11.  
  12. while(a > 0) if( i > 0)
  13. {
  14.     document.getElementById('cores').innerHTML += ' <div style="position: absolute; left:' + Math.round((Math.random() * (i - 1)) + 1) + 'px; top: ' +  Math.round((Math.random() * (a - 1)) + 1) + 'px; background-color:red;" >           <br/>           </div>';
  15.  
  16.     i -= 7;    
  17.     a -= 7;
  18. }
  19.  
  20.  
  21. </script>
  22.  
  23.  
  24. // Para tópico na comunidade Orkut Exploit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement