如何重写以下内容以使用变量:
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";