4

I have a web page with

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>

<div id="map_container">
        <div id="map_canvas"></div>
        <div id="directions"></div>
    </div>

CSS

#map_container {width: 500px; height: 500px; }
#map_canvas {width: 100%; height: 50%; border: solid thin black; }
#directions {width: 98%; height: 45%; border: solid thin black; overflow: auto;}

But its not showing scroll bars in iphone/ipad safari for directions. Although its showing scroll bars in FF, Chrome on windows/mac.

coure2011
  • 40,286
  • 83
  • 216
  • 349

3 Answers3

6

Overflow is supported in iPhone/iTouch/iPad. Just use 2 fingers (horizontal) to scroll the overflow portion but no scrollbar will be shown. Yeah I know, it sucks. People need to google it to find out...

trueblue
  • 76
  • 1
  • 2
5

i am using this css code for 1st iPod Touch.

#directions{
overflow-y: scroll;
overflow-x: scroll;
}
#directions::-webkit-scrollbar {
background: transparent;
height: 10px;
overflow: visible;
width: 10px;
}
#directions::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
-webkit-border-radius:5px;
}
#directions::-webkit-scrollbar-thumb:hover{
background-color: rgba(0, 0, 0, 0.6);   
}
#directions::-webkit-scrollbar-corner {
background: transparent;
}

In iOS5,

-webkit-overflow-scrolling: touch;

maybe, You will allow one finger to scroll. I did not try it yet.

piayo
  • 101
  • 2
  • 4
  • thanks for the hint. In 2020 in my case on iPhone6 in Safari and Opera Touch the `overflow: auto;` on the wrapper element did not work same as on desktop Chrome. I.e. the overflowed inner container on iPhone was scrolling but the part of its content was hidden: the inner scrolled container did not show all the elements presentedthere. The replace of `oveflow: auto;` to `overflow: scroll;` helped to solve the issue. – Valentine Shi Apr 10 '20 at 06:04
1

Two fingers scrolling never worked for me, try to use iscroll instead. Scroll bar is always hidden in ipad/iphone, it only shows up when you are scrolling it.

user227353
  • 2,594
  • 2
  • 15
  • 13