title: Float Divs With Window Scroll Within a Fixed Section
body: <p>I'm trying to scroll 2 div with page scroll in a fixed section. Here is the live URL to test online</p>
  
  <p><a href="http://imenudemo2.apphb.com/features-pricing" rel="nofollow noreferrer">Floating Div's Issue</a></p>
  
  <p><a href="https://i.stack.imgur.com/zV0Lt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zV0Lt.png" alt="enter image description here"></a></p>
  
  <p>above is the screen shoot of that section. I've tried position fixed and scroll function as well but nothing works for me.</p>
  
  <p>currently i'm on this stage</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.main-content {
    width: 100%;
    background-color: #ccc;
    padding: 10px;
  }
  
  .left-flot-div,
  .right-flot-div {
    width: 19%;
    height: 200px;
    background-color: #000;
    float: left;
  }
  
  .left-flot-div {
    margin-right: 1%;
  }
  
  .right-flot-div {
    margin-left: 1%;
  }
  
  .main-content-center {
    width: 60%;
    height: 1400px;
    background-color: red;
    float: left;
  }
  
  .clear {
    clear: both;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="main-content"&gt;
    &lt;div class="col-md-2"&gt;
      &lt;div class="left-flot-div"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="col-md-8"&gt;
      &lt;div class="main-content-center"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="col-md-2"&gt;
      &lt;div class="right-flot-div"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <pre><code>$('#ParentContainer').scroll(function() { 
      $('#FixedDiv').css('top', $(this).scrollTop());
  });
  </code></pre>