How can I make a div scroll to the bottom on load using jQuery? I have a DIV with a preset width and height and a jQuery function that gets content from MySQL (using a php script) and prints it to that div. The div has a scrollbar, hidden btw, and I want that div to be scrolled to the bottom on load. Is there a way to do this?
HTML:
<div id="showContent"></div>
jQuery:
var auto_refresh = setInterval( function()
{
$('#showContent').load('show.php').fadeIn('fast');
}, 500);
show.php
contains a while function, it works well.
CSS:
#showContent {
height: 250px;
margin: 10px;
margin-bottom: 3px;
overflow: auto;
padding: 5px;
width: 300px;
overflow: auto;
}