I would like to scroll The div bottom
to the bottom of the page when page loads but will also like to scroll back up when needed to how can i archive this without any animations how can i achieve this
echo "<div id='bottom'><p><b>$from_username</b><br />$message</p></div>";
<script>
function scrollpage() {
function f()
{
window.scrollTo(0,i);
if(status==0) {
i=i+40;
if(i>=Height){ status=1; }
}
setTimeout( f, 0.01 );
}f();
}
var Height=document.documentElement.scrollHeight;
var i=1,j=Height,status=0;
scrollpage();
</script>
this is what i have so far, i am able to scroll down automatically but can not scroll up when i want to, what can i do if i want to scroll up ?