title: add / remove class in jquery window scroll function not working - blogger
body: <p>I ask for help, why my script is not working,</p>
  
  <pre><code>$(window).scroll(function() {    
  if ($(window).scrollTop() &gt; 1){  
      $('header').addClass("sticky");
  }
  else{
      $('header').removeClass("sticky");
  }
  });
  </code></pre>
  
  <p>I tried to replace <code>$(window).scroll(function() {</code> with <code>$(document).ready(function() {</code> ,still does not work</p>
  
  <p>for more details, you can open my page in <a href="http://versbubble.blogspot.com" rel="nofollow">versbubble.blogspot.com</a></p>