screen.width +安卓 [英] screen.width + android

查看:265
本文介绍了screen.width +安卓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我描绘出我的DroidX原生浏览器的screen.width,我第一次收到320如预期,但在随后的重载(不改变方向),我收到800 ...这是为什么?

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?

推荐答案

这是一个Android的bug。有时,当页面首次加载window.screen.width和window.screen.height是错误的。你可以尝试做一个暂停,然后运行code。

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);

在此还看到<一href="http://$c$c.google.com/p/android/issues/detail?id=12455&q=javascript%20width&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars">android问题

这篇关于screen.width +安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆