UPDATE 2017.12: For non-Safari browsers (e.g. Chrome, Firefox) you can use Safari however does not support it … UPDATE 2021.06: The
workaround below no longer seems to work in recent iOS/MobileSafari versions (iOS 12+) … 😭. Follow Webkit bug #176454 to stay up-to-date on support in Safari. Know this bouncy overscrolling behaviour that browsers have been doing whenever you reach the “edge” of the page its contents? Sometimes – in fullscreen apps for example – you’ll want to disable this. Now, there’s no need to resort to JavaScript and hijack
Tested with iOS8, iOS9, and iOS10. However, this snippet
disables *all* scrolling on the
You’ll most likely want to remove the Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …) Post navigationMobile iOS 사파리 overscroll/bounce 막기
2018. 3. 26. 22:01 html, body { position: fixed; overflow: hidden; } 전체를 감싸는 엘리먼트(예 .wrap)에 아래 스타일 적용 .wrap{ width: 100vw; height: 100vh; overflow-y: scroll; -webkit-overflow-scrolling: touch; } I don't want the content of my site sloshing around when the user hits the edge of a page. I just want it to stop. The omni-present javascript solution I see everywhere is this:
But this prevents scrolling entirely. Is there way to just remove the bounce. Preferably with CSS or a meta tag as opposed JS, but anything that works will do.
easwee 15.4k24 gold badges58 silver badges82 bronze badges asked Dec 9, 2013 at 1:15
emersonthisemersonthis 31.9k56 gold badges202 silver badges350 bronze badges I have to add another answer. My first approach should work, but, there is an iOS bug, which still bumbs the whole page, even if e.stopPropagation. mikeyUX find a workaround for this: https://stackoverflow.com/a/16898264/2978727 I wonder why he just get a few clicks for this great idea... This is how I used his approach in my case:
answered Dec 9, 2013 at 17:40
2 Disable bouncing by prevent the default behaviour of the document:
Allow scrolling by prevent that the touch reaches the document level (where you would prevent the scrolling):
Mind the difference between these two:
StopPropagation should be your choice here ! Here is a very good explanation: http://davidwalsh.name/javascript-events Edit: Same problem, same solution: document.ontouchmove and scrolling on iOS 5 Edit2: fixed typo in variable names added brackets after methods
answered Dec 9, 2013 at 3:41
Michael PMichael P 5851 gold badge4 silver badges21 bronze badges 6 If apply to Desktop Browser, don't need any JavaScript codes, just few lines of CSS codes:
answered Mar 11, 2015 at 11:34
rbtrbt 952 silver badges3 bronze badges 2 I tried lots of different approaches I found here on stackoverflow, but iNoBounce was the thing that really worked for me: https://github.com/lazd/iNoBounce I just included it in my index.html:
answered Dec 31, 2015 at 11:06
Lesh_MLesh_M 5868 silver badges6 bronze badges 4 This library is solution for my scenarios. Easy way to use just include library and initialize where you want like these;
If you want to prevent bouncing only on one element and not on the whole page you can do it like:
answered Mar 23, 2016 at 8:26
1 Found a code that worked to me, I believe it will work to you. The solution is written here: http://apdevblog.com/optimizing-webkit-overflow-scrolling/ Basically, you need to have this js code:
And then, have your scrollable divs with the class="scrollable". answered Feb 14, 2014 at 18:15
CesarCesar 3404 silver badges11 bronze badges 0 After trying these suggestions and reading several articles, the fix for me was to use the CSS property < overflow-x: hidden; > on the problematic element/container. answered May 30, 2019 at 22:27
|