thephpdev
thephpdev

Reputation: 1117

jQuery jScrollPane - temporarily disable scrolling without destroying the instance

I have a system with nested jScrollPane instances. There is a container, which uses jScrollPane, and several children where the jScrollPane instances are created and destroyed when they are opened up inside the main container. Now, the only problem is, when one of the nested instances is scrolled to the bottom, then scrolled some more, the main container is also scrolled (which I want to stop).

What I need to do, is temporarily disable scrolling on the main container's jScrollPane instance without affecting any of the nested instances.

If necessary, I can give a link to an online demo to show what I mean.

Thanks in advance.

Upvotes: 0

Views: 88

Answers (1)

thephpdev
thephpdev

Reputation: 1117

I had to modify the public API for jScrollPane. There are two functions (initMousewheel() and removeMousewheel()) that are not exposed in the public jQuery API. To fix this, I added the following after line 1400 of v2.0.21:

removeMousewheel: function() {
    removeMousewheel();
},
initMousewheel: function() {
    initMousewheel();
}

Upvotes: 0

Related Questions