最佳答案
我有一种时尚元素
position: relative;
transition: all 2s ease 0s;
Then I want to change its position smoothly after clicking on it, but when I add the style change the transition doesn't take place, instead, the element moves instantly.
$$('.omre')[0].on('click',function(){
$$(this).style({top:'200px'});
});
However, if I change the color
property, for example, it changes smoothly.
$$('.omre')[0].on('click',function(){
$$(this).style({color:'red'});
});
造成这种情况的原因是什么? 是否存在不是“过渡性”的属性?
编辑 : 我想我应该提到这不是 jQuery,它是另一个库。代码似乎按预期工作,样式正在添加,但转换只在第二种情况下工作?