screen.width + android

前端 未结 1 1218
刺人心
刺人心 2020-12-09 23:35

If I trace out the screen.width with my DroidX native browser, I first receive 320 as expected, but on subsequent reloads (without changing orientation) I receive 800... why

相关标签:
1条回答
  • 2020-12-10 00:03

    It is an Android bug. Sometimes when page first loads the window.screen.width and window.screen.height are wrong. You can try to make a timeout and then run your code.

    setTimeout(YourFunction, 200);
    

    Also see here android issue

    0 讨论(0)
提交回复
热议问题