• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

No scroll bar at DIV in Android browser

founder

Newbie
Dec 25, 2009
20
0
I just wanted to test how to move on a touchscreen the slider of a scroll bar, but big surprise, there is no scroll bar.

I have defined a DIV with overflow:auto

This means when the content of the DIV is greater than the DIV defined with style width and height, there should be scroll bars added to the DIV.

But at this test page the left menu is larger than the DIV, but no scroll bar is added to the DIV.

When you test it with an Android cell phone, You will have first scroll the screen to the left.

I scroll with

document.body.scrollLeft

to the right, if the screen is smaller than XVGA
this feature works fine in the Andoid browser,

Not only that there is no scroll bar added to the
DIV overflow=auto, this DIV is also not scrollable,
by javascript

Test page where the DIV should be scrolled down

Here my script tries to hold the menu entry from the current page
in the visible area of the DIV by

document.getElementById('dirsub').offsetTop

But the offsetTop does also not work.
Any work around?
Hope for a next browser release?
 
I would say that that is just yet another buggy quirk of the stock browser, but the same behavior is also seen when using the Dolphin and Infinity browsers as well, so I'd point the finger at the Webkit rendering engine.

Check this pretty informative page that shows what works and what doesn't in the many flavors of the Webkit engine based on device. Note that the Overflow directive is shown as "incorrect" for Androids.

The Great WebKit Comparison Table

chart
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones