title: Use added class as trigger in jQuery
body: <p>I'm using <a href="https://github.com/peachananr/onepage-scroll" rel="nofollow">THIS onepage-scroll.js</a> Plugin which gives the active content section a class .active. Now I want to hide an element when on the first section with the class .page1. So I wrote the following code: </p>
  
  <pre><code>if ( $('.page1.ops-section').hasClass("active")) {
      $('#navbar').animate({
          opacity: 0.0,
          height: "0px" }, 400
      );
   }
   else {
      $('#navbar').animate({
          opacity: 1,
          height: "60px",
          color: "red"}, 400
      );
   }
  </code></pre>
  
  <p>It checks if the .page1 div has the class .active and if so the #navbar div get's opacity:0. Else it get's opacity: 1. I placed this inside a $(document).ready(function() thing, but this only checks the condition when the page is loaded, I need to add something that does: </p>
  
  <pre><code>IF .page1 hasNo .active DO #navbar.animate
  and that get's triggered whenever a div get's this .active class
  </code></pre>
  
  <p>Any ideas?</p>