I have a scroll view in this fashion: a succession of views wrapped horizontally on a container.
<div id="scroller" ref="scroller" onClick=
{this.onClick.bind(this)} onMouseMove={this._onMouseMove.bind(this)}>
{this.state.pma.map((Item, index) => (
<this.state.typePma
key = {index}
pma = {Item}
onDateChange = {(child) => this.onDateChange(child)}
redisplay = {() => this.redisplay()}
/>
))}
</div>
I'd like to know how I can get the horizontal offset of the scrollview and manipulate it programmatically: I'd like to move my scrollview with simple drag with the mouse. For the moment, the behavior is that I need to drag the horizontal slidebar but that don't work if I try the same on the view.
I am really not sure what you are looking for, but if you are looking for a way to control the scroll behavior for lazy loading in your app, so for e.g, if the user reach the bottom of the scroll you want to load more data, you can do it like this.
But if you want to control the Scroll behavior through code you can do something like this. The code written below will scroll to the bottom of the page on componentDidMount() but this gives you an idea how you can control the scroll behavior in an imperative way.