Heim  >  Fragen und Antworten  >  Hauptteil

angular.js - AngularJS link函数里调用CSS transition transform 是瞬发的,

        link: function(scope, element, attrs) {
            element.parent().find('.right').css({
                'transition': "all 0.6s linear  0s",
                'transform':"rotate(180deg)" 

        });
        }

       页面显示直接就转了180度,没有0.6秒的效果。
迷茫迷茫2713 Tage vor565

Antworte allen(1)Ich werde antworten

  • 怪我咯

    怪我咯2017-04-17 11:19:34

    这么写试试呢?

    element.parent().find('.right').css({'transition': "all 0.6s linear  0s"});
    setTimeout(function(){
        element.parent().find('.right').css({'transform': "rotate(180deg)"});
    });
    

    Antwort
    0
  • StornierenAntwort