Jump to content
Search Community

Draggable scrollTop does not show native scroll bar on mobile.

x0b test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi,

 

I'm using scrollTop on a div and would like the native scroll bar to show on mobile. It does on the desktop and Chrome on Android 4.1.2 but doesn't on iOS 7.1.1 on iPhone 4S in either Safari or Chrome.

 

I have set -webkit-overflow-scrolling:touch in the css but it's not helping.

 

Any ideas?

 

Thanks

Link to comment
Share on other sites

Draggable sets the overflowX and overflowY to "hidden" on mobile devices because:

  1. There's a bug in some mobile browsers (like Android) that causes scrollTop to get forced back to 0 after it is altered via JS (a total show-stopper for a tool like Draggable)
  2. From what I understand, most (if not all) mobile browsers have that default behavior anyway (overflow is hidden). 

You could manually set the overflowX/overflowY back to "auto" or something AFTER you create your Draggable if you'd like to override that behavior. Like yourElement.style.overflowY = "auto";

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

Draggable sets the overflowX and overflowY to "hidden" on mobile devices because:

  1. There's a bug in some mobile browsers (like Android) that causes scrollTop to get forced back to 0 after it is altered via JS (a total show-stopper for a tool like Draggable)
  2. From what I understand, most (if not all) mobile browsers have that default behavior anyway (overflow is hidden). 

You could manually set the overflowX/overflowY back to "auto" or something AFTER you create your Draggable if you'd like to override that behavior. Like yourElement.style.overflowY = "auto";

Does this actually work for iOS?

Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...