为什么使用 moz-radial-gradient 滚动这么慢?
我将此样式属性附加到 body 标记:
style="background: -moz-radial-gradient(center center , circle , rgb(223, 224, 228), rgb(189, 193, 200)) no-repeat fixed 0% 0% #fff;"
并且滚动页面变得非常困难 - 它滞后并且滚动缓慢。 应该是这样吗?
编辑:不仅滚动,所有其他 jquery 效果也变慢。
I attached this style attribute to body tag:
style="background: -moz-radial-gradient(center center , circle , rgb(223, 224, 228), rgb(189, 193, 200)) no-repeat fixed 0% 0% #fff;"
And scrolling the page became very hard - it was lagging and scrolling slowly.
Is it supposed to be so?
Edit: Not only scrolling, all other jquery effects become slow too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
背景位置固定的渐变背景存在性能问题,这是一个已知问题。
这是您使用预发布 CSS(即带有浏览器前缀的任何内容,例如
-moz
)所付出的代价。大多数时候它们工作得很好,但只要它们有这个前缀,就表明供应商认为该功能还没有完成,所以您使用它需要您自担风险。Its a known issue that a gradient background with background-position:fixed has perfomance problems.
This is the price you pay for using pre-release CSS (ie anything with a browser prefix such as
-moz
). Most of the time they work fine, but as long as they've got that prefix, it indicates that the vendor doesn't consider the feature to be finished, so you use it at your own risk.