开发者

iphone safari not showing scroll bars [duplicate]

开发者 https://www.devze.com 2023-01-25 09:07 出处:网络
This question already has answers here: Problems with div vertical scrollbars on iPad (3 answers) Closed 8 years ago.
This question already has answers here: Problems with div vertical scrollbars on iPad (3 answers) Closed 8 years ago.

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>
    &开发者_StackOverflow中文版lt;/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.


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...


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消