title: random position of images
body: <p>i found a script that would position divs / images randomly. However, it isn't completely working the way i want/need it to.</p>
  
  <p>The images are loaded each within a div (which isn't ideal i guess). I have around 30 images.</p>
  
  <p>But they don't load nicely and <code>var posy = (Math.random() * ($(document).height() - 0)).toFixed();</code> doesn't work nicely either. The images mostly load on top (i think that the images in the blog don't count so it gets the height without images?)</p>
  
  <p>So what I want: Load the in more nicely Randomize them so they get to the bottom of the page, too</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var circlePosition = document.getElementsByClassName('circle');
  console.log(circlePosition);
  
  function position() {
    for (var i = 0; i &lt; circlePosition.length; i++ ) {
      //give circle a random position
      var posx = (Math.random() * ($(document).width() - 0)).toFixed();
      var posy = (Math.random() * ($(document).height() - 0)).toFixed();
  
  
  
      //apply position to circle
      $(circlePosition[i]).css({
        'position':'absolute',
        'left':posx+'px',
        'top':posy+'px',
      })
    } 
  } //end function position
  
  var circleTotal = circlePosition.length;
  
  $('.circle').click(function() {
    $(this).fadeOut();
    circleTotal = circleTotal - 1;
    console.log(circleTotal);
  
    if(circleTotal == 0) {
      position()
      $('.circle').fadeIn();
    }
  
  });
  
  position();</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;img src="//placehold.it/1x5000"&gt; &lt;!-- Placeholder image to show issue --&gt;
  &lt;div class="circle"&gt;
    &lt;img src="http://static.tumblr.com/tensqk8/k8anq0438/01.png"&gt;
  &lt;/div&gt;
  &lt;div class="circle"&gt;
    &lt;img src="http://static.tumblr.com/tensqk8/k8anq0438/01.png"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>