JavaScript转换翻译问题

时间:2016-07-12 05:08:14

标签: javascript css css-transforms

使用JavaScript的Chrome(webkit浏览器)中的好奇CSS转换行为......

var obj = document.getElementById('foooo');
// obj.style.transform == ""; 

obj.style.transform = "rotate(45deg)";  // works (another 2d transform)
obj.style.transform = "translate(-50px,0px)";         // fails as "" (bug?)
obj.style.WebkitTransition = "translate(-50px,0px)";  // fails as ""
obj.style.MozTransition = "translate(-50px,0px)";     // fails as ""
obj.style = "transform: translate(-50px,0px)";  // works (solution)

为什么会发生这种情况,或者这个错误是否可重复?

0 个答案:

没有答案