Comments (4)
Hi @PierBover
I cannot say what's wrong exactly, but I think you shouldn't do it that way. I think the problem is that you manipulate original container and forget about wrapper that is added by custom scrollbar. You can init scrollbar on some wrapper inside your body and update it's content with your html.
Also, you can destroy scrollbar before detaching it from the body $html.scrollbar('destroy')
, and then init it again after attaching your $html back.
from jquery.scrollbar.
@gromo That was my first approach, but then I needed to add a scroll event only for one of the scrollable contents (to detect the scrolling position).
from jquery.scrollbar.
@PierBover
it's still not clear for me what you're doing and what is the problem. Can you prepare simple (as simple as possible) example for me to look at?
from jquery.scrollbar.
I was loading content dynamically into the scrollable area. For some content I needed to know the scroll position using a scroll()
event to do some animations when something becomes visible for the user.
If I had a single scrollable div, and changed it's content dynamically, I would have to add and remove the event listener dynamically depending on the content to prevent the scroll event triggering forever.
So instead of having a scroll zone in the page, I added a scrollable div wrapper to each content. The problem was that your scroll plugin only worked the first time I attached it to the DOM. When I reattached the content to the DOM it stops working.
I needed to solve this so I ended up not using your plugin, but that was the problem.
from jquery.scrollbar.
Related Issues (20)
- jQuery Maximum call stack size exceeded HOT 1
- Disable jquery scrollbar for iOS? HOT 2
- vertical scrolling stuck when the scrollbar-content is forced shifted HOT 3
- prohibit the scroll bar scroll HOT 1
- Not working in Firefox 57 HOT 2
- How to destroy this plugin HOT 1
- scroll-bar drag and drop support on touch device HOT 5
- Invalid regular expression: /(^|\.)scrollbar_2(\.|$)/ HOT 3
- Ignore webkit/blink browsers HOT 2
- archive project / search for maintainers HOT 5
- Как перейти сразу в конец блока? ("go to end" button) HOT 1
- scrollbar not working with latest version of jquery 3.3.1 HOT 2
- Scrollbar not initialized on touchpad devices HOT 4
- backward scroll not working oninit HOT 1
- How do I scroll to an id of an element? HOT 2
- I am seeing two scrollbars in (Responsive Mode in Firefox)
- scrollbar is jumping to beginning after click elem select HOT 2
- ght range error $.ajax HOT 4
- Firefox , IE and Edge native scrollbar HOT 1
- OnScroll event firing before initialize
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery.scrollbar.