title: Javascript div random positioning
body: <p>The problem is that i'm learning in javascript and i don't know everything yet.
  I want to do a div with random position. I found this:</p>
  
  <pre><code>(function makeDiv(){
    var divsize = ((Math.random()*100) + 50).toFixed();
    var color = '#'+ Math.round(0xffffff * Math.random()).toString(16);
    $newdiv = $('&lt;div/&gt;').css({
      'width':divsize+'px',
      'height':divsize+'px',
      'background-color': color
    });
  
    var posx = (Math.random() * ($(document).width() - divsize)).toFixed();
    var posy = (Math.random() * ($(document).height() - divsize)).toFixed();
  
    $newdiv.css({
      'position':'absolute',
      'left': posx+'px',
      'top': posy+'px',
      'display': 'none'
    }).appendTo('body').fadeIn(100).delay(300).fadeOut(200, function(){
      $(this).remove();
      makeDiv(); 
    }); 
  })();
  </code></pre>
  
  <p>and it is what I wanted mainly but not exactly.</p>
  
  <p>I want to modify this code where I have one <code>&lt;div&gt;</code> element in body and it's position just changes on mouseover. I have this now: 
  <a href="http://screenshot.sh/m7WhBlRPAQ7vs" rel="nofollow noreferrer">http://screenshot.sh/m7WhBlRPAQ7vs</a><br>
  It doesn't work and I don't know why.</p>