title: jQuery Smooth Scrolling
body: <p>I've tried to implement smooth scrolling into an index of info.  I've looked at this jsFiddle <a href="http://jsfiddle.net/9SDLw/" rel="noreferrer">http://jsfiddle.net/9SDLw/</a> and I cannot get it to work.  Does it matter where the code is inserted into the HTML Document or something?</p>
  
  <p>Here is my code:</p>
  
  <p>JS (in head of document):</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $('a').click(function(){
      $('html, body').animate({
          scrollTop: $( $(this).attr('href') ).offset().top
      }, 500);
      return false;
  });​
  &lt;/script&gt;
  </code></pre>
  
  <p>Markup:</p>
  
  <p>Link </p>
  
  <pre><code>&lt;a href = "#G" rel = "" id="G" class="anchorLink"&gt;G&lt;/a&gt;&lt;br /&gt;
  </code></pre>
  
  <p>Anchor</p>
  
  <pre><code>&lt;a name = "G" id="G"&gt;&lt;span class = "letters"&gt;G&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
  </code></pre>
  
  <p>What am I missing here?</p>