I can't make the following work on Android 3.1/Honeycomb (only Android version tested), but it works everywhere else - including on other WebKit-based browsers, e.g. on iPhone.
A DIV with fixed dimensions:
<DIV id="TestDiv" style="width:300px;height:200px;overflow:auto;">Lorem ipsum dolor sit amet, etc.</DIV>
A line of JavaScript or jQuery to scroll it down after page has loaded:
document.getElementById("TestDiv").scrollTop = 100;
$("#TestDiv").scrollTop(100);
I also tried wrapping the above in a setTimeout
to introduce a small delay from the loading of the page. It is sometimes needed with webkit, but it did not help here.
I have seen programmatic DIV scrolling work on my Android 3.1. device so I know it can be done. The question is how?
EDIT: Please notice, I am looking for a web solution that also works in the stock browser of Android, not a native Android solution.