title: Add/remove class with jquery based on element height scroll?
body: <p>Hello i use this jquery function to add a class on the vertical scrolling page. but i want to remove this class on end of an element that it has variable height on all pages.
  For example in on page this element height is 400px and on another page it's 1000px and ...
  how can i measure the element height and remove the class on that height?</p>
  
  <pre><code>$(window).scroll(function() {    
      var scroll = $(window).scrollTop();
  
      if (scroll &gt;= 500) {
          $(".clearHeader").addClass("darkHeader");
      } else {
          $(".clearHeader").removeClass("darkHeader");
      }
  });
  </code></pre>