Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nested scroll areas - inner scroll does not get focus #11

Closed
haveboard opened this issue Dec 7, 2011 · 4 comments
Closed

nested scroll areas - inner scroll does not get focus #11

haveboard opened this issue Dec 7, 2011 · 4 comments

Comments

@haveboard
Copy link

I need to nest a scrolling area within another scrolling area.

It seems the only way that you can scroll a nested area is by using the mouse to grab and drag the scrollbar in the nested scroll area.

The only other way is if you are at the top or bottom of the parent scroll area, you can scroll the top inner scroll area up and the bottom inner scroll area down when at the bottom.

mousewheel scrolling on a nested scrolling area does not seem to get focus.

@ghost
Copy link

ghost commented May 24, 2012

Today I ran into the same situation and fixed it. You can find my fork here: https://github.com/9livesdevelopment/jQuery-slimScroll

I also fixed an issue with checking if it's already bound. It used hardcoded values so when you override the defaults the check wouldn't work. Now it contains this code

    //ensure we are not binding it again
    if (me.parent().hasClass(o.wrapperClass))

Anyway,

My solution for the issue was to introduce a special class .slimScrollPriority. This is used to set a global variable called priorityScrollingActive to true. You can find it top of the js file.

To bind them this is what I do:

            $('.slimScroll').slimscroll({
              color: '#000',
              size: '8px',
              width: '100%',
              height: '100%'
            });

            $('.slimScrollPriority').slimscroll({
                  color: '#000',
                  size: '8px',
                  width: '100%',
                  height: '100%',
                  wrapperClass: 'slimScrollDivPriority'
            });   

It works very smooth for me. If you have any questions let me know and I'll see what I can do to help.

Cheers,
René
9Lives Development.

@nsitu
Copy link

nsitu commented Feb 5, 2013

René, Is it possible to nest/embed multiple vertical scrolling areas within a single horizontal scrolling area? Do you have an example of this?

@nsitu
Copy link

nsitu commented Feb 5, 2013

I think I've got a solution, by copying your slimScrollPriority method over to the slimScrollHorizontal.js, however, it only works when alwaysVisble = false

@ghost
Copy link

ghost commented Feb 6, 2013

I am not sure if it will work with my "hack".

Tbh it isn't the most beautiful solution I've used, but it does the job for our project.
A better solution would be for the slimscroll object to have children and keep track if children are scrolling. Actually block parents :)

Unfortunately I don't have to the time to update the library at the moment :(

ramsay added a commit to ramsay/jQuery-slimScroll that referenced this issue Feb 18, 2013
rochal added a commit that referenced this issue Feb 19, 2013
Fixes issue #11: Nested slimScroll innerMost
rochal pushed a commit that referenced this issue Feb 19, 2013
@rochal rochal closed this as completed Apr 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants