Slow CSS Filters on iPhone?

2020-05-03 11:50发布

I have a div with this css class:

.pos {
    -webkit-filter: brightness(0.5);
    -moz-filter: britghtness(0.5);
    -o-filter: brightness(0.5);
    -ms-filter: brightness(0.5);
    filter: brightness(0.5);
}

And on my iPhone it runs slow. If I remove those attributes everything goes fast. How can I use these attributes without slowing the page down?

1条回答
霸刀☆藐视天下
2楼-- · 2020-05-03 12:17

I found the solution here: http://indiegamr.com/ios6-html-hardware-acceleration-changes-and-how-to-fix-them/

It's about adding these proprieties:

-webkit-transform: translateZ(0);
-webkit-perspective: 1000;
-webkit-backface-visibility: hidden;

Hope this will help!

查看更多
登录 后发表回答