title: margin-top of div equal to height of an other div
body: <p>I am using the code below. I need in <code>$('#scrolloverlay').css('margin-top' , '')</code>;` the margin-top to be equal to the height of ".image-in-slider". ".image-in-slider" may vary in height depending on browser window size. Can anyone help please?</p>
  
  <pre><code>$(document).ready(function(){
        $(window).on('scroll' , function(){
          var WindowScrollTop = $(this).scrollTop(),
              Div_one_top = $('.image-in-slider').offset().top,
              Div_one_height = $('.image-in-slider').outerHeight(true),
              Window_height = $(this).outerHeight(true);
          if(WindowScrollTop+Window_height &gt;= (Div_one_top +  Div_one_height) ){
  
            $('#scrolloverlay').css('z-index' , '0');
            $('#scrolloverlay').css('margin-top' , '');
          }else{
             $('#scrolloverlay').css('margin-top' , '3000px');
            $('#scrolloverlay').css('z-index' , '0');
          }
        }).scroll();
      });  
  </code></pre>