title: Jquery window resize keeps increasing height of div
body: <p>I'm currently developing a website with a div that needs to be increased and descreased with the background-image.</p>
  
  <p>The js that I have now works fine, except when resizing the window it keeps on increasing the height pixels.</p>
  
  <pre><code>   $(document).ready(function() {
          $('.content-repeat').each(function(){
              var parentHeight = $(this).parent().height();  
              $(this).innerHeight(function(i,x){
              return x + parentHeight -284+'px';
              });
              $(this).css('margin-top',-parentHeight +170+'px');
              $(this).css('margin-bottom',-170+'px');
          })
          $(window).on('resize', function(){
          $('.content-repeat').each(function(){
              var parentHeight = $(this).parent().height();  
              $(this).innerHeight(function(i,x){
              return x + parentHeight -284+'px';
              });
              $(this).css('margin-top',-parentHeight +170+'px');
              $(this).css('margin-bottom',-170+'px');
          })  
          })
      });
  </code></pre>
  
  <p>Do you have a suggestion for how to fix this issue?</p>