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

no_scroll: true not working on mobile #4

Closed
generatepress opened this issue Nov 2, 2015 · 8 comments
Closed

no_scroll: true not working on mobile #4

generatepress opened this issue Nov 2, 2015 · 8 comments

Comments

@generatepress
Copy link

I noticed that the no_scroll: true parameter isn't working on mobile devices.

Also, you may want to add overflow: auto to the slideout menu area to enable scrolling if the menu items reach below the initial viewport.

On Chrome, when you scroll down (as it allows you to scroll), the URL area disappears and leaves a gap below the slideout menu the same height as the URL area was. This will probably be fixed when the no_scroll thing is fixed.

Let me know if you need more info - great script! :)

@ahmedrad
Copy link
Owner

ahmedrad commented Nov 3, 2015

You're right looks like my scroll disable script doesn't support touch devices @generatepress .. I'll update and close the issue once I test it!

Thanks for point it out 👍

@generatepress
Copy link
Author

Awesome, thanks!

@ahmedrad
Copy link
Owner

ahmedrad commented Nov 6, 2015

Ok It's updated and tested on nexus 5 and iphone 6 .. the scroll flag should be working on mobile now. You can test it out here

I'm gonna close this issue for now but just let me know if you run into any related issues or open a new one if it's unrelated 😄 @generatepress

@ahmedrad ahmedrad closed this as completed Nov 6, 2015
@generatepress
Copy link
Author

Looks like it's working - thanks! :)

However, my slide out content is longer than the initial viewport on mobile, so I had to add overflow: auto to it.

This update made it so I can't scroll within my slide out content on mobile either - seems to have disabled mobile scrolling altogether instead of just within the body content.

@ahmedrad
Copy link
Owner

ahmedrad commented Nov 7, 2015

Yeah the listener that prevents scroll is attached to the body so it applies to all elements. Can you send me a fiddle or a live page that you're working with? I have an idea I can try out as a quick fix. the plugin wasn't really designed for large pieces of content that's why I never considered that case but I could potentially have a quick fix for it @generatepress

@generatepress
Copy link
Author

Maybe this will help: http://codepen.io/anon/pen/rOqyNd

Basically it would be great if we were able to scroll inside the slideout element. Some mobile phones don't have a lot of visible room, so scrolling can be necessary to see all links or content.

Thanks! :)

@ahmedrad
Copy link
Owner

ahmedrad commented Nov 8, 2015

Ok I see, the disable scroll function is pure javascript so it attaches to window. Try dropping my no_scroll functionality and using this instead https://github.com/ultrapasty/jquery-disablescroll

I'll try porting over my code to jQuery that will probably help with but I think it'll take time for me to do it and test it on a bunch of browsers so in the mean time give that plugin above a shot, I think it can solve your problem @generatepress

@generatepress
Copy link
Author

I found the best way to do this is to add a class to the body element when the slider is opened.

Then just add some simple CSS:

.slide-opened {
    overflow: hidden;
}

.slideout-content {
    overflow-y: auto;
}

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

2 participants