title: Javascript margin left on scroll
body: <p>I want the margin left to stop at a certain point</p>
  
  <pre class="lang-js prettyprint-override"><code>var data = $('#nexttologodiv').css('margin-left');
  var init = 220, 
      $page = $('#nexttologodiv').css('margin-left', init);
  
  console.log(data);
  
  window.onscroll = function() {
    if (data == '220px'){
      $page.removeClass( 'scrolled' );
      console.log(window.scrollY);
      $page.css('margin-left', init - window.scrollY * 2);
    }
    else if (window.scrollY &lt;= 48) {
      $page.css('margin-left', 0 - window.scrollY);
    }}
  }
  </code></pre>