+ 2

How to make the massages aligned bottom to top

https://code.sololearn.com/W6qd856q3uN2/?ref=app I am trying to make a chat bot web page. The massages appear on the top and when the page full the new messages gone to bottom. Then to check the massages It have to scroll the page Please any idea how to scroll the page automatically??

2nd Jul 2018, 10:46 AM
Ayush kumar
Ayush kumar - avatar
3 Answers
+ 4
Hi Ayush kumar ! In your function send( ), add the below code: if(app.scrollTop + app.clientHeight < app.scrollHeight) { app.scrollTop += app.scrollHeight - (app.scrollTop + app.clientHeight); } This will automatically scroll the bottom of the webpage. Also, add "bottom" CSS property instead of "top" your input box and send button: bottom: 12px;
2nd Jul 2018, 11:33 AM
777 - avatar
2nd Jul 2018, 11:32 AM
CalviŐ˛ - avatar
+ 1
Thanks very much Rahul
2nd Jul 2018, 2:13 PM
Ayush kumar
Ayush kumar - avatar