Scrollbar.init() not found #570
Unanswered
radoslaw-redzik-ggsitc-com
asked this question in
Q&A
Replies: 3 comments
-
Can you share your repository or live site? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Unfortunatelly this webpage is in restricted mode, not available publicly. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I don't exactly know what your project's structure is, is it React or Pure JS? If you are using import Scrollbar from 'smooth-scrollbar`
window.Scrollbar = Scrollbar make sure to use console.log(window.Scrollbar) // not working
window.addEventListener('load', () => {
console.log(window.Scrollbar) // works
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have such a problem.
I have loaded smooth-scrollbar.js file into my website. I have a div item with class="data-scrollbar". When javascript finds this element, it should run up a constructor. But it does not. I have an error in console: Uncaught TypeError: Cannot read properties of undefined (reading 'init')
It appears on this piece of code:
After
Scrollbar = window.Scrollbar
the variableScrollbar
is still undefined. AFAIK it should befunction e() { return null !== t && t.apply(this, arguments) || this }
. And this should invoke this piece of code (init):On the page there is much more js files. Is this possible there is a conflict between them? How to find, what js files causes conflict?
Can you help me? Why this is not working?
Regards
Radosław
Beta Was this translation helpful? Give feedback.
All reactions