title: div centered with jQuery
body: <p>I have this piece of jQuery code that center a div into it's parent.</p>
  
  <pre><code>$(document).ready(function(){
      function move_div(){
          parent_width = $('.holder').parent().width();
          parent_height = $('.holder').parent().height();
  
          obj_width = $('.holder').width();
          obj_height = $('.holder').height();
  
          $('.holder').css('top', (parent_height / 2) - (obj_height / 2)).css('left', (parent_width / 2) - (obj_width / 2));
      }
          move_div();
  
      $(window).resize(function(){
          move_div();
      });
  });
  </code></pre>
  
  <p>I wanted to use this on multiple div's but couldn't because the code only grab the height + width of the first div with the class 'holder' ... can anyone help solve this... ?</p>