title: Floating menu with jquery by using scrollTop()
body: <p>I am new to jquery and yesterday I was trying to make my own floating menu with jquery because I couldn't get satisfactory results with css. But the code that I wrote didn't worked. Can you guys please tell me what I'm doing wrong?</p>
  
  <p>What I want to do is the menu should reappear and stay in the top when I've gone down a few pixels.</p>
  
  <p>Here's the jquery code I'm using:-</p>
  
  <pre><code>var menu = function(){
      var x=$(body).scrollTop();
      if(x&gt;10){
          $('header').animate({position:fixed},100);
      }
      else{
          $('header').animate({position:static},100);
      }
  }
  
  $(document).ready(menu);
  </code></pre>