CSS3 transition with jQuery .addClass and .removeClass

前端 未结 5 2189
灰色年华
灰色年华 2021-02-07 05:34

I have a big main navigation panel that I want to animate when it\'s deploying (expanding).

I\'m working with jQuery to trigger the visibility of it by adding/removing t

5条回答
  •  佛祖请我去吃肉
    2021-02-07 06:00

    I am tired of this issue, better use animation:

    .container .element.animation  {
        animation: SHW .5s;
        animation-fill-mode: both
    }
    @keyframes SHW {
        from {
            transform:scale(0.7);
            opacity:0
        }
        to {
            transform: scale(1);
            opacity:1
        }
    }
    

    Add only to .element class .animation and its working:

    $('.container .element').addClass('animation');
    

提交回复
热议问题