title: Get amount of pixels scrolled from a div's height + its distance from the top
body: <p>I'm looking for a way in jQuery or pure JS to get the amount of pixels scrolled, not from the top of the page, but from the bottom of a div.</p>
  
  <p>In other words I need to turn the amount scrolled beyond a div's height + its pixel distance from the top of the page into a variable. </p>
  
  <p>I want to append this parallax code below so instead of calculating from the top of the page, calculates from a target div's distance from the top + its height. </p>
  
  <pre><code>/* Parallax Once Threshold is Reached */
  
  var triggerOne = $('#trigger-01').offset().top;     
  
  $(window).scroll(function(e){
  
    if ($(window).scrollTop() &gt;= triggerOne) {
  
      function parallaxTriggerOne(){                                   
        var scrolled = $(window).scrollTop();
        $('#test').css('top',+(scrolled*0.2)+'px');
      }
  
      parallaxTriggerOne();
  
    } else {
      $('#test').css('top','initial');
    }  
  
  });
  </code></pre>
  
  <p>I realize I didn't phrase this quite clear enough, I'm looking to only get the value of the amount of pixels scrolled since passing a div, so for example if I had a 200px tall div at the very top of the page and I scrolled 20 pixels beyond it, that variable I need would equal 20, not 220.</p>