自动调整Android手机大小 [英] Auto Resize Mobile Android
问题描述
大家好,
我建立了一个移动网站,我想在更改方向时自动调整所有内容...
我的元标记:
Hello all,
I build a website for mobile, and I want to autoresize all when change the orientation...
My meta tag:
<meta name="viewport" content="width=device-width, user-scalable=no"/>
我已经尝试过数学,用JS修改meta标签中的initial-scale,我花了几个小时数学,但是。 ..我失败了!
所以我尝试了一个简单的throttledresize:
I habe already tried with math, modifyingg "initial-scale" in the meta tag with JS, I spend some hours with math, but... I FAIL!
So I tried with a simple "throttledresize":
$(window).bind('orientationchange', function(event) {
$(window).trigger("throttledresize");
}
它运作良好,是啊! :D
但是..它在iPhone上运行良好,在Android NOOO上...在android上它唯一擅长风景模式,在肖像模式下它不是!!!
我已经在PX中完成了我的CSS,而不是在PERCENTAGE中,因为图像使用百分比不正确,设计师很傻我知道...
请帮帮我...
问候,
KZ
And its working well, yeahh!!! :D
But.. its working well on iPhone, on android NOOO... on android its only good at "landscape" mode, in "portrait" mode it is NOT!!!
I have done my CSS in PX and not in PERCENTAGE, because the images are incorrect for percentage use, the designers are stupid I know...
Please help me...
Regards,
KZ
推荐答案
( window )。bind(' orientationchange', function (event){
(window).bind('orientationchange', function(event) {
( window ) .trigger( throttledresize);
}
(window).trigger("throttledresize"); }
它运作良好,是啊!!!:D
但是......它在iPhone上工作得很好,在android NOOO上...在android上它唯一擅长风景模式,在肖像模式下它不是!! !
我已经在PX中完成了我的CSS,而不是在PERCENTAGE中,因为图像使用百分比不正确,设计师很傻我知道...
请帮帮我...
问候,
KZ
And its working well, yeahh!!! :D
But.. its working well on iPhone, on android NOOO... on android its only good at "landscape" mode, in "portrait" mode it is NOT!!!
I have done my CSS in PX and not in PERCENTAGE, because the images are incorrect for percentage use, the designers are stupid I know...
Please help me...
Regards,
KZ
这篇关于自动调整Android手机大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!