5

I'm looking for a way to disable the momentum scrolling on Chrome for Android device. I have a div with a fixed height and I want to be able to scroll the content of that div but without the smooth effect.

On iOS it's easy, I just havn't add the "-webkit-overflow-scrolling: touch", but it looks like Chrome for Android apply this automatically.

When I inspect the code with Chrome -> Device inspection I don't see this property so I think that Chrome do that nativly and I havn't found a way to prevent that.

I tried preventDefault on touchend but it doesn't work.

Any suggestion ?

Thanks. :)

tsbits
  • 63
  • 1
  • 6
  • This post might help: http://stackoverflow.com/questions/15906508/chrome-browser-for-android-no-longer-supports-webkit-overflow-scrolling-is-the – Benjamin Cuslidge Sep 04 '14 at 23:58

1 Answers1

0

This is a quote from code.google.com from the chromium project

"We removed -webkit-overflow-scrolling with the hopes that it was no longer necessary because we'd automatically opt-in to fast scrolling when we need."

-webkit-overflow-scrolling: touch;

That rule got removed somwhere between Jan and Feb in 2013
The only way to get around the problem now on Chrome something to do it like this

<div style="overflow: auto">
    <div style="z-index: 0">
        Content
    </div>
</div>

The fix would be to set zindex: 0 on only "overflow: scroll" elements.

Owain van Brakel
  • 3,109
  • 1
  • 15
  • 22
  • Thanks for the reply. Yeah, I saw in the documentation that they removed the property. By the way I tried your solution but it's not working for me. Am I doing something wrong ? ( http://codepen.io/tsbits/pen/hociy ). Thanks again for your help. – tsbits Sep 08 '14 at 13:27