title: Position a div dynamically below another?
body: <p>I try to use jQuery to detect the position of a div (.field_slide-produit), so I can use that position to place another div (.slider-content) exactly below it on the bottom left and i need to replace this div dynamically on window resize.</p>
  
  <p>I've used this code, but it's not working, an idea why ?</p>
  
  <pre><code>var offset = $('.field_slide-produit').offset();
  var height = $('.field_slide-produit').height();
  var width = $('.field_slide-produit').width();
  var top = offset.top + height + "px";
  var right = offset.left + width + "px";
  
  $('.slider-content').css( {
  'position': 'absolute',
  'right': right,
  'top': top
  });
  
  // listen the window changes and correct the newdiv position
  $(window).resize(function(){ slider-content(); });
  </code></pre>
  
  <p>This code is in a codepen here : <a href="http://codepen.io/Laurentfrom47/pen/wJEKVb" rel="nofollow noreferrer">http://codepen.io/Laurentfrom47/pen/wJEKVb</a></p>
  
  <p>Thanks</p>