Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey guys,

I'm writing a web app using ASP.NET MVC. I'm trying to implement a couple of lists which must display well on regular webbrowsers, and also on mobile devices (browsers on smartphones and tablets). One of the features i'm trying to create is infinite scroll on those lists. The javascript (i'm using jQuery 1.6.4) works fine in any browser except for browsers on the Android platform.

The problem is that the scrollTop function always returns 0, while the browsers on all other plaforms return the value of the scrollbar's current position.
<div class="scroll">allow scrolling for this div</div>

Each div with the class scroll attached to it, has an overflow: scrollbar style and a fixed size. When the scrollbar hits the bottom, it should trigger a new function allowing the page to load a new set of data, which will be added to the existing list of data. But since the scrollTop() on android devices always return 0 I cannot detect that the scrollbar hits the bottom and thus a new portion of data should be loaded.
alert($("div.scroll").scrollTop()); // Always displays 0 on android

Any idea? Thanks a lot!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900