Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance translate3d在css3动画中是否表现更好?_Performance_Css_Translate3d - Fatal编程技术网

Performance translate3d在css3动画中是否表现更好?

Performance translate3d在css3动画中是否表现更好?,performance,css,translate3d,Performance,Css,Translate3d,我一直在搜索,花了很多时间在网上,以获得顺利 动画 当您使用translate3d设置如下元素属性时,是否正确 它将自动触发硬件cpu加速的属性 .someclass { /*does it trigger hardware cpu acceleration*/ transform: translate3d(0,0,0); -webkit-transform: translate3d(0,0,0); -moz-transform: translate3d(0,0,

我一直在搜索,花了很多时间在网上,以获得顺利 动画

当您使用translate3d设置如下元素属性时,是否正确 它将自动触发硬件cpu加速的属性

.someclass {
    /*does it trigger hardware cpu acceleration*/
    transform: translate3d(0,0,0);
    -webkit-transform: translate3d(0,0,0);
    -moz-transform: translate3d(0,0,0);
    -ms-transform: translate3d(0,0,0);
    -o-transform: translate3d(0,0,0);
}
设置之后,是否必须对其3d属性设置动画?或者你能制作动画吗 任何css属性

要制作动画,我有另一个类

.connectanimation {
    -moz-transition: all .7s ease;
    -moz-transition: all .7s ease;
    -ie-transition: all .7s ease;
    -o-transition: all .7s ease;
    transition: all .7s ease;
}
然后,我使用jQuery设置div元素的动画

jQuery('#somedivid').on('mouseover', function() {
    jQuery(this).removeClass('connectanimation').addClass('connectanimation');
    jQuery(this).css("margin-top","100px");  // a normal css transition 
    //jQuery(this).css('MozTransform', 'translate3d(0px, 100px, 0px)');  // or this way?
});
我在这里做的对吗?我应该用什么来制作动画以获得最佳性能? 如果这是被翻译的方式。。然后我会在我的代码中为 支持其他浏览器,如opera、chrome等,对吗

问候,


Chris。

所有3D属性都是在移动和桌面设备上硬件加速的。但是,只有Webkit和Firefox(最近)支持3D转换属性