Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Safari Vertical Scrolling Feels Sticky (With No Momentum)

Tags:

I've got a problem with vertical scroll in iOS Safari on a web page: while being scrolled, page moves in a very slow way, with high resistance (such behavior is not usual for iOS browsers)

My attempts to locate the problem:

<!-- piece of HTML listing -->
<body>
    <div id="wrapper">
          (here goes some content)
    </div>
</body>

I detected the problem in the overflow-x:hidden; rule for div#wrapper, changing it to 'overflow:hidden;' or removing it dynamically in web debugging panel.

Is there any chance to fix it without changing the page layout?

Repeats on Safari / iOS 6.1.4 and 7 (both iPad and iPhone), also in iOS Simulator on OS X.

like image 707
Artem Okladov Avatar asked Sep 25 '13 07:09

Artem Okladov


People also ask

What is webkit overflow scrolling?

The -webkit-overflow-scrolling CSS property controls whether or not touch devices use momentum-based scrolling for a given element.

Why is my safari not scrolling?

Many people have trouble with their scrolling on Safari. If you are having problems with Safari, you can try to fix this by checking system preferences on your computer. Click on accessibility, then go to pointer control. You can adjust the scrolling speed to fix the problem.

What is momentum scroll?

Momentum scrolling (also called Inertial scrolling) is an interaction technique that applies acceleration to an element (a page, image, div, etc.) so it scrolls by quickly.

How do I stop Safari from scrolling IOS?

Usually, we can use overflow: hidden on the <body> element to prevent scrolling.


1 Answers

You can try to add the webkit specific css line to you div:

#wrapper{
    -webkit-overflow-scrolling: touch;
}

read more about momentum and ios scrolling here: http://css-tricks.com/snippets/css/momentum-scrolling-on-ios-overflow-elements/

like image 89
RecycleRobot Avatar answered Oct 29 '22 06:10

RecycleRobot