最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - screen.width + android - Stack Overflow

programmeradmin1浏览0评论

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 is this?

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 is this?

Share Improve this question asked Feb 16, 2011 at 19:22 workedworked 5,8805 gold badges56 silver badges79 bronze badges 2
  • What do you mean by "trace out"? – Cheryl Simon Commented Feb 16, 2011 at 21:36
  • 1 Can no one confirm this? Is it a bug? – worked Commented Feb 25, 2011 at 12:39
Add a ment  | 

1 Answer 1

Reset to default 7

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)

  1. 暂无评论