Is it possible to add indicators to a div to show users that they can scroll left or right within the content? I need a way to detect if the element can be scrolled to either side, so that I can display the appropriate indicator. For example, when there is content hidden on the right, show a right indicator, and once the user scrolls, show a left indicator for scrolling in the opposite direction. Here's a sample setup: https://jsfiddle.net/udv8u596/
(You can scroll horizontally, scrollbar is intentionally hidden)
HTML:
<div class="scroll-container">
<div class="scroll-content>
Scroll Me Horizontally Scroll Me Horizontally Scroll Me Horizontally Scroll Me Horizontally Scroll Me Horizontally Scroll Me Horizontally Scroll Me Horizontally
</div>
</div>
CSS:
.scroll-container {
width: 80%;
margin: 0 auto;
background: cyan;
overflow-y: hidden;
height: 36px;
}
.scroll-content {
padding: 10px 0;
height: 50px;
white-space: nowrap;
overflow-x: scroll;
overflow-y: hidden;
}