Reputation: 2734
I have a div
that scrolls just fine on a desktop browser, but on a mobile device with a touchscreen, scrolling isn't working.
Here is a stripped down jsFiddle with bits of actual code. The scrolling will work fine for you in your mobile browser, but trust me when I say that exact same code is not scrolling when on a touchscreen device.
The actual device I'm using is an LG Optimus Elite Android device.
You may see that I'm using the slimScroll library, but rest assured that is not the issue, as I have it implemented elsewhere in my code, successfully (even on a touchscreen).
Besides, I've tried removing slimScroll and just using native scrolling, with the same (negative) result.
It's like the touchscreen device isn't registering my touch to scroll the div.
EDIT: Looks like scrolling also works fine on an iPhone (same screen size as the LG Optimus Elite). So the problem perhaps lies with Android...?
Upvotes: 3
Views: 3679
Reputation: 2734
@Coop was correct about the phone's OS being the culprit.
The phone in question was running Android 2.2.x and didn't support scrollable divs.
I came to a solution by using the SlimScroll plugin to force the div in question to allow scrolling.
Doesn't work as well as native scrolling, but gets the job done well enough.
Upvotes: 2