2

我需要在我的网站上覆盖背景,并且我总是看到鼠标悬停或任何其他操作时出现滞后/slug。你知道如何解决这个问题吗?我在这里有一个工作示例(如果我还没有更新代码): http: //natgeo.geryit.com

ul#posters li {
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    float: left;
    height: 170px;
    position: relative;
    width: 25%;
}
4

1 回答 1

10

似乎 webkit 不会缓存调整大小的图像并每次都渲染它,从而导致延迟。

当谈到 chrome 中的背景大小时,你很不走运。

我见过人们用 Javascript / jQuery 来做这件事。请参阅http://srobbin.com/jquery-plugins/jquery-backstretch/

于 2011-10-23T20:53:33.500 回答