简体   繁体   中英

Scrollbars in scrollable div's in mobile browsers cross-platform

I'm using scrollable div's (with the CSS element overflow:scroll) to build me a page for tablets running Android 3.2+, BlackBerry Playbook and iOS5+ (iPad 1 not supported).
I got this working but I would like scrollbars. For iOS5 there is this supported webkit code snipped which I add to the CSS styles. This makes really nice 'native' like apple scrollbars:

-webkit-overflow-scrolling: touch;

Is there something similar which works on Android and the BlackBerry? A CSS/webkit solution would be best but JavaScript is fine too as long as it's not a large plugin as iScroll or similar.
What I tested too but doesn't work as it 'lags' really bad on all platforms is the following:

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}

Thanks for your help!

I have not yet found a cross platform CSS solution for this yet. I have how ever used a lightweight js solution touch scroll https://github.com/neave/touch-scroll

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM