Auto Refresh Without Effecting Scrolling
<p>I have a auto chat section where I have to get the scrollbar of chat to the bottom. Like this:</p>

<pre><code>function chatuser(user1) {
    $("#currentuser").load('chatcontent.php', {
        current: user1
    }, function afterchatuser() {
        $("#currentcontent").attr({
            scrollTop: $("#currentcontent").attr("scrollHeight")
        });
    });
}

&lt;div id="currentuser"&gt;&lt;/div&gt;
</code></pre>

<p>For the auto update I automatically refresh the function. Like this:</p>

<pre><code>var auto_refresh = setInterval(function chatauto() {
    chatuser(user1);
}, 2000);​
</code></pre>

<p>But every time it refreshes where ever the scrollbar is,it gets to the bottom. Like if the user scrolls to the top, after the refresh it automatically gets the scrollbar to the bottom. I want to stop this, but also it should get refreshed timely. Please help me.</p>
