我的网站上的chrome设计再次出现问题。滚动时不会丢失fps和页面滞后。我花了很多时间才发现问题的真正罪魁祸首是属性background-attachment: fixed;
。
我试图用这个页面的解决方案来解决,但没有为我工作。
https://petersproblems.wordpress.com/2014/12/06/background-attachment-fixed-causing-lag-when-scrolling/
我想使用background-attachment: fixed;
,没有延迟,有什么解决方案吗?
CSS:
body {
margin: 0 auto;
background-image: url(imagen/fondo.jpg);
background-repeat: repeat-x;
background-attachment: fixed;
background-position: top center;
}
只需添加-
transform:translatez(0);
-webkit-transform:translatez(0);