title: jQuery to top function disallows scrolling
body: <p>I'm creating magento shop and i want to make toTop button available after user scrolls the window. </p>
  
  <p>I paste mine code bellow, it works fine, but after window is on top, i can't move it anymore, it's stuck.</p>
  
  <pre><code>jQuery(window).scroll(function() {
      var top = jQuery(window).scrollTop();
  
      if (top &gt; 77) {
      jQuery(function() {
          jQuery('img.arrowup').fadeIn();
          jQuery('div.header_bg').show();
          jQuery('div.mainmenu').addClass('stick');
          jQuery('body div.header-container').next().addClass('pad');
          jQuery("img.arrowup").on('click', function(e) {
          e.preventDefault();
          jQuery('body,html').animate({scrollTop:10},800);
      });
      })} else {
          jQuery('div.header_bg').hide();
          jQuery('img.arrowup').fadeOut();
          jQuery('body div.header-container').next().removeClass('pad');
          jQuery('div.mainmenu').removeClass('stick');
      }
  
  });
  </code></pre>
  
  <p>============================</p>
  
  <p>Thanks everybody for help, here's working solution with stick header and toTop animation :)</p>
  
  <pre><code>    var scrollDiv=jQuery(this);
      jQuery(window).scroll(function(){  
          if(jQuery(window).scrollTop()&lt;="77"){
              jQuery("img.arrowup").fadeOut("slow");
              jQuery('div.header_bg').hide();
              jQuery('div.mainmenu').removeClass('stick');
          } else {
              jQuery("img.arrowup").fadeIn("slow");
              jQuery('div.header_bg').show();
              jQuery('div.mainmenu').addClass('stick');
          }
      });
      jQuery("img.arrowup").click(function(){
          jQuery("html, body").animate({scrollTop:0},"slow");
      });
  </code></pre>