iScroll does not work in android unless you do a orientation change and back

3.8k Views Asked by At

hi i have a website i created and it is using iScroll so basically i have a fixed width on a div tag, and it will become scroll-able if the content is too long.

the same code i have iscroll applied works fine on iphone and ipad

however, on android, when the webview is first loaded in portrait mode it is not scrollable, but if you put it in landscape, and then back to portrait, then you are able to scroll.

why orientation change in android affect iScroll? how can i fix this for android?

1

There are 1 best solutions below

0
On

The #wrapper on which you defined iscroll should be fixed and the immediate child div should take the total width of the content. Try initializing the iscroll after the content is rendered and the width is calculated if there is any dynamic loading and then call the iscroll refresh() method after iscroll is initialized. Let me know if i got your problem right and this solves your issue. Define absolute position.