【问题标题】:Background Image Slow Scrolling背景图像慢速滚动
【发布时间】:2012-06-22 19:43:17
【问题描述】:

我正在尝试使用 css3 实现根据屏幕大小自动调整大小的背景图像。我在使用 Chrome 时遇到了一个问题,它使网站垂直滚动变得非常缓慢。这不会发生在 Opera、Firefox 或 IE 上。我是否在我的 css 代码中遗漏了声明,还是 Chrome 是罪魁祸首?

 body { 
 background: #000 url(../images/bg.jpg) no-repeat center center fixed;  
 -webkit-background-size: cover;    
 -moz-background-size: cover;   
 -o-background-size: cover;  
 padding: 0; 
 margin: 0 }

【问题讨论】:

    标签: css


    【解决方案1】:

    我可能有点晚了,但我自己也遇到了类似的问题,在这里找到了问题的答案:

    My fixed background made scrolling the site very slow, what can I do to improve it?

    似乎 background-size 属性是导致问题的原因。当然删除它会引发某些浏览器的其他问题,但也许使用这个 Jquery 插件可能会解决这个问题,但我自己还没有测试过: http://srobbin.com/jquery-plugins/backstretch/

    【讨论】:

      【解决方案2】:

      可能这一切都取决于在 mac os 中的渲染。 Mac os 在 windows 中使用 opengl 而不是 Direct3d。尝试在 chrome 中禁用\启用硬件加速并检查它是如何工作的

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-04-03
        • 2018-12-24
        • 1970-01-01
        • 2018-02-11
        • 1970-01-01
        • 1970-01-01
        • 2013-08-14
        • 2011-08-30
        相关资源
        最近更新 更多