title: jQuery .CSS opacity not working
body: <p>I wrote a short script in JS to mimic effect made in Flash.
  It is working in <code>FF</code> 3.6, but it not working in <code>Chrome, Opera or IE8</code>.
  Everything is working except <code>.css({opacity: opacity});</code></p>
  
  <p>Have I missed something? Thanks. edit: I was missing closing quote.</p>
  
  <p>Live: <a href="http://webarto.com/static/demo/cubes/" rel="nofollow">http://webarto.com/static/demo/cubes/</a></p>
  
  <pre><code>var cubes = 16;
  
  var x = cubes;
  var y = cubes;
  var n = 1;
  
  $(document).ready(function () {
      var cubes = $("#cubes");
      for (i = 1; i &lt;= x; i++) {
          for (j = 1; j &lt;= y; j++) {
              cubes.append('&lt;div id="cube_' + n + '"&gt;&lt;/div&gt;');
              n++;
          }
      }
  
      setInterval(cube, 50);
  
  });
  
  function cube() {
      var rand = Math.floor(Math.random() * 256);
      var opacity = Math.random() * 0.8;
      $("#cube_" + rand).css({
          opacity: opacity
      });
  }
  </code></pre>
  
  <p>Thanks to @Gaby aka G. Petrioli for optimization.</p>