Jump to content
Search Community

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

Posted

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

Posted

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
  • 1 year later...
Posted

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.

Posted

Are you saying it doesn't work for you? Do you have a sample (codepen) that shows the issue? 

Posted

Thanks for the reply Jack!

 

I made a small pen: 

See the Pen XKJewx by wim67 (@wim67) on CodePen.

It has a scrollbar on a desktop, not on an iPad.

Posted

Oh, right, iOS just doesn't show scrollbars like that. It's an iOS browser thing. I think Apple considered it a waste of visual space for a touch device. 

  • Like 1
Posted

I believe Windows 10 does the same thing, but different for desktop, where it won't show scrollbars unless you start scrolling on desktop.

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