I'm trying to speed up an interface by using native HTML/CSS scrolling instead of manually setting the offset using the difference between a drag start and drag end. It's simple enough to enable scrolling but I also need to manipulate items according to the horizontal scroll position.
Imagine a graph where labels are placed along the x-axis marking the start of each day. As the user scrolls the graph div across (keeping the y axis on the left and not interfering with the rest of the page) I want the day label to come into view and then when the start of that day goes too far off to the left the label sticks to the edge until a new label for the next day comes in to replace it, like this page.
I can lock labels to the left and fade it out as appropriate using fixed css, but what I need help with is triggering the different CSS states according to horizontal position. I think I could make it work if there was a value I could use in calc(). I have found some CSS ways of changing values based on vertical movement.
Some sample code incase it helps
<div id="outerDiv" style="overflow-x: scroll; width: 100px">
<div id="innerDiv" style="width: 3000px">
<div>Day 1</div>
<div>Day 2</div>
<div>Day 3</div>
</div>
</div>