title: js Make a smooth scroll
body: <p>I seriously have a question about the scroll event. I tried to solve it all night but I couldnt. </p>
  
  <p>I am trying stick a navigation on the top. The stick effect will process when <code>$(window).scrollTop()</code> pass the point right before the navigation.</p>
  
  <p>The problem is, there will have a "blink" effect (its like delay process) on IE and Chrome but not on Firefox.</p>
  
  <p>While on my research I knew that Firefox has "smooth scroll" by default.</p>
  
  <p>However, please check this example on Chrome or IE </p>
  
  <p><a href="http://www.backslash.gr/demos/jquery-sticky-navigation/" rel="nofollow">http://www.backslash.gr/demos/jquery-sticky-navigation/</a></p>
  
  <p>It is so smooth like on Firefox, and the code is just that simple......</p>
  
  <p>The point is, I am doing the exactly same thing like this example but why I have the 'blink' effect??</p>
  
  <p><strong>Is the trick on CSS ??</strong></p>
  
  <p><strong>Is there any way that I can create a smooth scrool like what on firefox by js??</strong></p>
  
  <p>Thank you very much for your help.</p>
  
  <pre><code>$(window).on('scroll', Sticky);
  
  function Sticky(){
      $(this).scrollTop() &gt; anchor.offset().top
      ? nav.css({ 'position': 'fixed', 
                        'z-index': z_index, 
                         top: y, 
                         left: x, })
      : nav.css({ 'position': 'static', });
  };
  </code></pre>