I have a scroll-bar in a div element and initially it\'s position is top. Whenever i add some text to the div element then the scroll-bar does not move. Is there any way, th
Here you go. Follow this concept.
$('#messages').scrollTop($('#messages')[0].scrollHeight);
#chatbox-history {
overflow: none;
position: relative;
width: 100%;
height: 200px;
border: 1px solid #ccc;
}
#messages {
overflow: auto;
position: absolute;
bottom: 0;
width: 100%;
max-height: 200px;
}
#messages div {
border: 1px solid #e2e4e3;
margin: 5px;
padding: 10px;
background: #fafafa;
}
asdjf ;asd
ajsd fa ;skd f;s
asdjf ;akjs d;lf a;lksd fj
ajsd fkaj s;dlf a;ljsdl;fkja;lsd f; asd
Wassup?