Scrollto while scrolling
<p>I isolated the most I can my code into this : <a href="http://jsfiddle.net/uXVWu/">http://jsfiddle.net/uXVWu/</a></p>

<p>HTML :</p>

<pre><code>&lt;a id="stopHere" &gt;Hi !&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
</code></pre>

<p>JS :</p>

<pre><code>var theAnchor=document.getElementById("stopHere");
var tempX,tempY;

function stopScroll(e)
{
    var c=parseInt(document.getElementById('stopHere').offsetWidth);
    var d=parseInt(document.getElementById('stopHere').offsetHeight);
    if(tempX&lt;=c&amp;&amp;tempY&lt;=300+d&amp;&amp;0&lt;=tempX&amp;&amp;300&lt;=tempY)window.scrollTo(0,200);
}

function update(e)
{
    var doc=document.documentElement;
    var body=document.body;
    tempX=(e.pageX)?e.pageX:e.clientX+(doc&amp;&amp;doc.scrollLeft||body&amp;&amp;body.scrollLeft||0)-(doc&amp;&amp;doc.clientLeft||body&amp;&amp;body.clientLeft||0);
    tempY=(e.pageY)?e.pageY:e.clientY+(doc&amp;&amp;doc.scrollTop||body&amp;&amp;body.scrollTop||0)-(doc&amp;&amp;doc.clientTop||body&amp;&amp;body.clientTop||0);
}

window.onscroll=stopScroll;
window.onmousemove=update;
</code></pre>

<p>CSS :</p>

<pre><code>#stopHere
{
    float:left;
    width:100%;
    border:1px solid black;
    text-align:center;
}
</code></pre>

<p>What does the program is that if the cursor is on the <code>&lt;a&gt;</code>, then you scroll, the <code>&lt;a&gt;</code> will be on the top. What I want is that you scroll over it and it goes on the top. How can it works?</p>
