JavaScript – Scrolling DIV stuck down on content load

  • Home / Blog / JavaScript – Scrolling…

JavaScript – Scrolling DIV stuck down on content load

I have a handy messaging app, but the messages contain content that is sometimes very long. As such, I’ve implemented a “View More” and “View Less” buttons that display the full content, or clipped version of the content, respectively. The chat view is inverted so that new chats are closer to the bottom. If the scroll is at the bottom of the scroll dive below the bar, clicking “View more” loads the content, but the scroll gets stuck at the bottom (the user will have to click “View more”) And then go to the top of the long message before you can start reading. How can I make it so that scrolling to the current location is fixed, even if the user scrolls through the entire section below Div.

I’ve tried filling and margins at the bottom of ScrabbleDev, or scrolling to the top of the message automatically when clicked, but it didn’t work, and worse yet Is.

Video is attached to explain the behavior (first behavior is wrong, second is right): link to video

Write a Comment

Your email address will not be published. Required fields are marked *