-
i have tried multiple methods but couldn't get it work, console.log(scrollbar.offset); it always showing undefined any code for jquery will be helpful. |
Beta Was this translation helpful? Give feedback.
Answered by
idiotWu
Aug 29, 2021
Replies: 1 comment 1 reply
-
const scrollbar = Scrollbar.get(elem /* the element on which the scrollbar is initialized */);
console.log(scrollbar.offset); You can also use the scrollbar.addListener(({ offset }) => {
console.log(offset);
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
idiotWu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
scrollbar.offset
is an instance property, so you need toYou can also use the
addListener()
method to get offset on scrolling: