I have a shoutbox and I want to keep the scroll to bottom same as IM windows.
My html is
<div id="shoutContainer">
<table id="shoutbox">
<tbody>
<!-- shouts here -->
</tbody>
</table>
</div>
My css
#shoutContainer {
height: 100px; overflow-y: scroll;
}
If its not possible through html and css. Can we achieve this in raw javascript? because I am not using any framework
I have a shoutbox and I want to keep the scroll to bottom same as IM windows.
My html is
<div id="shoutContainer">
<table id="shoutbox">
<tbody>
<!-- shouts here -->
</tbody>
</table>
</div>
My css
#shoutContainer {
height: 100px; overflow-y: scroll;
}
If its not possible through html and css. Can we achieve this in raw javascript? because I am not using any framework
Share Improve this question asked Apr 16, 2010 at 13:30 ShishantShishant 9,29415 gold badges59 silver badges81 bronze badges2 Answers
Reset to default 14Whenever an item is added, do the following:
document.getElementById('shoutContainer').scrollTop = 10000;
// or some other big number
edited
I'm not sure you can do this with CSS alone, but here's a great jQuery solution: Ajaxdaddy shoutbox.
Here is a free shout box service to keep your client happy:
Free shoutboxes.
I just made one to make sure it's ok, example here.