I am looking to implement scrolling for just the "chat-messages" div within the "chat-bar" div on my site. I want only this specific section to be scrollable, while the rest of the site remains stationary. Currently, I have to scroll through the entire page in order to view the "input-row" div. When I apply overflow: auto
to the "chat-bar" div, it causes the entire input-row
to also become scrollable. Can someone provide me with the best CSS/HTML solution to fix this issue? Alternatively, recommendations for a simple JavaScript library would be greatly appreciated.
Here is the link to my jsfiddle:
jsfiddle.net/o9vmfgpx/3
Update: I was able to find a solution, although it feels somewhat like a workaround.
.chat-messages {
overflow-y: scroll;
-ms-overflow-style: none;
}
.chat-messages::-webkit-scrollbar {
display: none;
}
@-moz-document url-prefix() {
.chat-messages {
right: -5%;
padding-right: 3%;
}
}
This solution has been tested and works on the latest versions of IE, EDGE, Chrome, Firefox, and Opera (as of October 14th, 2016).