【发布时间】:2014-07-18 03:49:47
【问题描述】:
所以我在我的网站上使用 BackStretch jQuery 插件,到目前为止它运行良好。我看到的唯一问题是,在移动垂直屏幕上,当我开始向下滚动时,底部会出现一个空白白条 - 就在顶部 url 和底部浏览器菜单缩小/消失之后。当顶部和底部浏览器栏消失时,body 标记中的背景似乎没有记录它需要调整大小。关于如何解决这个问题的任何想法?我正在使用 Boostrap 3.0,并且在垂直滚动条上出现了一些白条问题,但我能够使用 overflow-x:hidden 修复它。任何想法将不胜感激。该网站位于http://ivynursery.jacobbuller.com - 您可以在关于http://ivynursery.jacobbuller.com/about.php 和联系http://ivynursery.jacobbuller.com/contact.php 页面上查看问题。
这是我为 body 和 container div 准备的 css:
html,
body {
height: 100%;
position: relative;
}
body {
overflow-x: hidden;
/* Removes right space for browser scrollbar on mobile */
}
.container {
margin-right: 15px;
/* Adjust content to make up for hidden x-overflow 15px on mobile */
}
@media (min-width: 768px) {
.container {
margin-right: auto;
/* Adjust content to middle for non-mobile */
}
}
【问题讨论】:
-
你只是想获得一个完整的视口背景吗?
-
是的,基本上不需要使用 background-size:cover css 属性就可以得到一个完整的扩展背景,因为我想让它像 IE 8
-
也许这有助于不确定jsfiddle.net/DGu64
标签: twitter-bootstrap mobile scroll background-image jquery-backstretch