Replies: 1 comment 1 reply
-
@sipitai in const instance = $('.scrollbar_element').overlayScrollbars({
callbacks: {
onScroll: function(e) {
const scroll_info = this.scroll(); // use this as the instance
const max_y = scroll_info.max.y;
const pos_y = scroll_info.position.y;
// do something
}
}
}).overlayScrollbars(); In |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I have a single element, and want to get the scroll information from within the onScroll callback, I can use the following code:
But if I have multiple elements, the same code cannot be used.
With multiple elements,
instance
requires an index, but there's no index to use.Firstly, is this the correct way of getting scroll information from within a callback? I couldn't find any relevant documentation for this.
And secondly, if it is, when there are multiple elements, how do I get the scroll information for the correct element?
Also, in the same situation, how would I add a class to the correct element(s) from within a callback?
Beta Was this translation helpful? Give feedback.
All reactions