0

如何重写以下内容以使用变量:

element.style.webkitTransition = "opacity 1.0s ease";

我尝试了这些,但它们都不起作用:

var kDuration = 1.0;
element.style.webkitTransition = "opacity kDurations ease";

var kDuration = 1.0;
element.style.webkitTransition = "opacity kDuration ease";

var kDuration = 1.0;
element.style.webkitTransition = "opacity kDuration s ease";

var kDuration = 1.0;
element.style.webkitTransition = "opacity kDuration + s ease";

var kDuration = 1.0s;
element.style.webkitTransition = "opacity kDuration ease";
4

1 回答 1

0
var kDurationfirst = "1.0s"; var kDuration= "opacity "+kDurationfirst +" ease";
element.style.webkitTransition = kDuration ;
于 2012-09-06T19:50:36.443 回答