window.location.replace vs scrollTop
<p>I am running on Chrome with the following snippets:</p>

<pre><code>&lt;a name="example"&gt;&amp;nbsp;&lt;/a&gt;
</code></pre>

<p>The following code works correctly. It actually goes to #example as expected.</p>

<pre><code>window.location.replace('#example');
</code></pre>

<p>But the following does <strong>not</strong> work. It always go to the top of the page -- not to the <code>#example</code>.</p>

<pre><code>var target = $('a[name="example"]');
var offset = target.offset();
var top = offset.top;
console.log(top);
$('html, body').animate({scrollTop:top}, 'slow');
</code></pre>

<p>The <code>top</code> returns value 500+ something.
What am I missing?
Thanks in advance for your help.</p>

<p>UPDATE:</p>

<p>After removing the following CSS</p>

<pre><code>position: fixed;
</code></pre>

<p>The above jQuery code works!. But I need this page to be "position: fixed;".
How do I make the above jQuery code works with "position: fixed;"?</p>
