当第一次应用给定时间的转换持续时间时,比如说" 250ms",然后将转换持续时间设置为0(meaning there will be no effect),jQuery(从1.11.1开始)仍然保持原始过渡期为" 250ms" (见小提琴)。 将持续时间设置为" 0ms" (而不是0),它相应地起作用(不发生转换持续时间)。这是设计还是错误? A.k.a.我应该报告;)
var duration = "250ms";
$("#dot").on("click", function(){
$(this).css({
transitionDuration: duration,
transitionTimingFunction: "ease",
transform: 'translate3d(' + Math.floor(Math.random() * 20) + 1 + 'px, '
+ Math.floor(Math.random() * 20) + 1 + 'px, 0px)'
}).text( duration );
duration = 0;
});
transitionDuration, set to 0 after 1 click (works) jquery 1.11.0
transitionDuration, set to 0 after 1 click (bug?) jquery 1.11.1
transitionDuration, set to "0ms" after 1 click (fix) jquery 1.11.1