Abhi Burk Abhi Burk - 1 year ago 65
Javascript Question

Want My Scroll Bar always at the bottom but its not working for me

My Html Div In Which Chat is in While Loop So I want My Scroll Always at Bottom But Its Not Working For Me Plz Help Me to Figure it Out

<div class="panel-body">

CSS Code

.panel-body {
padding: 15px;
height: 350px;
overflow: auto;

I used two diffrent Given Below Script




var myDiv = document.getElementByClassName(".panel-body");
myDiv.scrollTop = myDiv.scrollHeight;

Answer Source

You can do it easily using javascript...


See the sample code here...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download