IScroll does not work in android unless you change the orientation and go back

Hi, I have a website that I created and it uses iScroll so basically I have a fixed width in the div tag and it will become scrollable if the content is too long.

the same code i used iscroll works fine on iphone and ipad

however, on android, when the web view is first loaded in portrait mode, it does not scroll, but if you put it in landscape mode and then back into portrait, you can scroll.

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

+4
source share
1 answer

#wrapper on which you defined iscroll should be fixed, and the immediate child div should accept the total width of the content. Try initializing iscroll after rendering the content, and the width is calculated if there is any dynamic loading, and then the iscroll refresh() method is called after iscroll initialization. Let me know if I understood your problem correctly and this will solve your problem. Determine the absolute position.

+2
source

Source: https://habr.com/ru/post/1412924/


All Articles