Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scrolling doesn't work on IPhone

On all devices scroll works but not working on iPhone

@media only screen and (-webkit-min-device-pixel-ratio: 0) {
@supports (-webkit-overflow-scrolling: touch) {

body {
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust:none;
  height: 1300px!important;
  position: relative!important;
  background-image: radial-gradient(circle at center , #0c505f, #053540 );
  color: #0c505f;
  width: 95%!important;
}
like image 817
Alina Bayron Avatar asked Aug 23 '26 15:08

Alina Bayron


1 Answers

When you dynamically add content to a div with -webkit-overflow-scrolling: touch; that exceeds the div in height, it becomes broken and unscrollable. You can fix this by constantly having an inner div, that triggers the scrollbar because its 1px higher than the outer div: - (Patrick Muff)

.outer {
  overflow: scroll;
  -webkit-overflow-scrolling: touch;
  /* More properties for a fixed height ... */
}

.inner {
  height: calc(100% + 1px);
}
like image 155
bcr Avatar answered Aug 25 '26 05:08

bcr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!