title: How to get the length of page scrolled vertically and add it to something?
body: <p>I have a half visible (using max-height) div that contains some text, I want to add the length of page scrolled to the max-height. I used</p>
  
  <pre><code>var topScroll = window.pageYOffset || document.documentElement.scrollTop;
  </code></pre>
  
  <p>But its returning <code>60</code> instead of <code>60px</code> or <code>50</code> instead of <code>50 px</code> that's making my max height <code>60xxx px</code> <code>50xxx px</code>.</p>
  
  <p>My JavaScript code:</p>
  
  <pre><code>var topScroll  = window.pageYOffset || document.documentElement.scrollTop;
  topScroll = parseInt(topScroll);
  $('#' + topScroll ).append("px");
  console.log(""+topScroll);
  
  var elem = document.getElementById("content");
  var articleHeight = window.getComputedStyle(elem, null).getPropertyValue("max-height");
  
  $(window).scroll(function (){
      var x  = topScroll + articleHeight ;
      $('.article-on').css('max-height',x);
      console.log(""+x);
  });
  </code></pre>