Open willhoney7 opened 8 years ago
Yes, it exposes an update method. Specify the position you want to scroll to in your outer directive.
Can you help me how to use this update function? For example I have:
<div ng-controller="exampleCtrl">
<div scrollbar></div>
</div>
and how to call update(x) from exampleCtrl or how to bind this to this directive.
@Mossar you would do it inside another directive's link function. So in your example your outer div would need to be another directive and when defining that controller you would add your update code in the outer directive's link function. See the documentation here under 'Creating Directives that Communicate'
I need to be able to update the scroll position. Is there some sort of
scrollIntoView()
method? So I could pass in a node and it would scroll until it was visible. Another, simpler, option would be asetScrollPosition
method where I could find the element position myself and just update the scroller to where I need it to go. Is there something available to accomplish what I need currently? As of now I'm planning on just hacking the top position css... but that's not very pretty.Thanks so much for ngTinyScrollbar – it's great!