GithubHelp home page GithubHelp logo

Comments (4)

gromo avatar gromo commented on August 21, 2024

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.

PierBover avatar PierBover commented on August 21, 2024

@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.

gromo avatar gromo commented on August 21, 2024

@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.

PierBover avatar PierBover commented on August 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.