tags:

views:

66

answers:

1

Developing an iPad website i tried to use the CSS property overflow: auto to get the scrollbars if needed in a DIV, but my device is refusing to show them even if the two fingers scroll is working.

I tried with

overflow: auto;

and

overflow: scroll;

and the result is the same...

i'm only testing on an iPad (on desktop browsers works perfectly).

Any ideas? Thanks.

+2  A: 

Unfortunately neither overflow: auto, or scroll, produces scrollbars on the iOS devices, apparently due to the screen-width that would be taken up such useful mechanisms.

Instead, as you've found, users are required to perform the two-finger swipe in order to scroll the overflow-ed content. The only reference, since I'm unable to find the manual for the phone itself, I could find is here: tuaw.com: iPhone 101: Two-fingered scrolling.

The only work-around I can think of for this, is if you could possibly use some JavaScript, and maybe jQTouch, to create your own scroll-bars for overflow elements. Alternatively you could use @media queries to remove the overflow and show the content in full, as an iPhone user this gets my vote, if only for the sheer simplicity. For example:

<link rel="stylesheet" href="handheld.css" media="only screen and (max-device width:480px)" />

The preceding code comes from A List Apart, from the same article linked-to above (I'm not sure why they left of the type="text/css", but I assume there are reasons.

David Thomas
that's very useful!So there aren't CSS-only ways to achieve this?
mat_jack1
Sadly not, all variations of css that might apply scroll-bars to page elements are, unfortunately, *verboten*. The only options are: 1, use JavaScript to emulate (what should be a native function) or, preferably, 2, use the @media queries to create mobile-specific stylesheets that obviate the need for scrolling-elements.
David Thomas