search

Home  >  Q&A  >  body text

css3 - 用angularjs给元素添加和删除样式类时,css规定的transition动画未出现

css

我在css中定义了上面这样的动画,想通过添加/删除.checked类来控制img元素淡入淡出。

html

这个.checked是用angularjsng-class来添加和删除的,也就是上面红色框里的hideCheck变量为true,则添加这个类,为false,则删除这个类。

javascript

然后如上图,我在js代码中赋值hideCheckfalse,然后再赋值为true,没有发生任何动画效果,请问应该怎样才能使动画出现?

黄舟黄舟2864 days ago669

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 11:13:16

    Write transition inside checked.

    Also, I want to complain, why do so many people here like to post codes into pictures? Is it so difficult to format the code here? If the question you asked contained a little more code, would you still be thinking about someone else typing the code in it line by line?

    reply
    0
  • Cancelreply