2015-04-27 76 views
2

我有一个类似的问题,这个:Software keyboard resizes background image on AndroidAndroid的软键盘调整大小的背景图像(网站)

给出有针对Android开发的解决方案。他们没有帮助。我正在为使用CSS/JavaScript的网站寻求解决方案。

我现在的CSS:

#video_mob { 
position: fixed; 
background: url(../terminal/background.gif) no-repeat center center fixed; 
background-size: cover; 
-webkit-background-size: cover; 
top: 0px; 
left: 0px; 
min-width: 100%; 
min-height: 100%; 
width: auto; 
height: auto; 
z-index: -1000; 
overflow: hidden; 
} 

一个选项排序修复它,但实际上后台向上本身转移。

-webkit-background-size: 280% auto; 

还有其他想法? CSS或JS解决方案欢迎。

+0

是啊......这个问题可能对你有帮助.http://stackoverflow.com/questions/11099930/100-width-background-image-with-an-auto-height – Ali786

+0

这里有一个想法,试着'背景 - 附加:固定'http://www.w3schools.com/cssref/pr_background-attachment.asp – sweeds

+0

'背景附件:固定'没有工作,但感谢sweeds调查:)我找到了一个解决方案下面。 – osteopathx

回答

2

嗯,解决方案找到了!傻我。

FYI这是要求:

background: url(../terminal/background.gif) no-repeat center top fixed; 
background-size: 280% auto; 

不得不设置的位置到中心顶部。

+0

如果这解决了您的问题,请将您的解决方案标记为答案......它看起来像是这样。 – Hassaan

+0

我必须等待2天才能做到这一点,哈哈 – osteopathx