开发者

Ipad and CSS attribute overflow

I tried to add right scroll in div. This works in most browsers, but not properly when using iPad Safari. Does the iPad not suported this css attribute?

I prepared test html. It do not work too.

<html>
    <head&开发者_如何学Cgt;
        <style>
            .ounner {
                border: solid 1px red;
                width:300px;
                height: 500px;
                overflow:scroll ;
            }
            .inner{
                border: solid blue 1px;
                height: 700px;
                width: 400px;
            }
        </style>
    </head>
    <body>
        <div class="ounner">
            <div class="inner">
                sdsd
            </div>
        </div>
    </body>
</html>


overflow: auto and overflow: scroll are supported on MobileSafari, but since scrollbars are not used on iOS, to scroll these areas one must use two fingers.

There is a JavaScript library called iScroll that handles touch events and implements one-finger momentum scrolling manually; perhaps that would be worth looking into.


I have used css:

-webkit-overflow-scrolling: touch;

and scrolling works with 1 finger as well (iPad 2, iOS 5.1.1).

Hope it helps, Filip

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜