简体   繁体   English

在IE10和&IE 11中,在div上转换属性3d的速度非常慢

[英]Transform Property translate 3d on a large div is very slow in IE10 && IE 11

We are changing the translate 3D on a DIV that is very large. 我们正在更改非常大的DIV上的转换3D。 It has thousands of child DIV's in it. 它具有成千上万的子DIV。 It is handled properly in chrome and firefox. 可以在chrome和firefox中正确处理。 But IE 10 && IE 11 is very very sluggish. 但是IE 10 && IE 11非常缓慢。 Any idea what can be done to make this better. 任何想法都可以做些什么来使它更好。 Below is the line of javascript code that changes this property. 以下是更改此属性的javascript代码行。

currentDIV.style[transformProperty] = 'translate3d(' + (-left) + 'px,' + (-top) + 'px,0) scale(' + zoom + ')';

the "transformProperty", "left" "top" and zoom are variables that are set before the line. “ transformProperty”,“ left”,“ top”和zoom是在行之前设置的变量。 Thanks. 谢谢。

translate3d forces the layer onto the GPU for rendering, and IE may not be handling that well. translate3d强制将层放到GPU上进行渲染,而IE可能处理得不好。

Have you tried a 2D translate instead? 您是否尝试过2D translate If the slowdown does not occur then, you could target IE specifically with the 2D translate without changing much code. 如果没有出现速度下降的情况,则可以将IE专门用于2D translate而无需更改太多代码。

Adding the following style property helped me to improve the translate3d performance. 添加以下样式属性有助于我提高translate3d性能。

-webkit-backface-visibility: hidden;
backface-visibility: hidden;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM