CSS3 transition with jQuery .addClass and .removeClass

前端 未结 5 2111
灰色年华
灰色年华 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:05

    You are adding and removing the class that contains the transition CSS. I recommend moving that to its own rule DEMO.

    .hidden{
        max-height: 0px;
    }
    .visible{
        max-height: 500px;  
    }
    
    #repair-drop{
        -webkit-transition: max-height 0.8s;
        -moz-transition: max-height 0.8s;
        transition: max-height 0.8s;
    }
    

提交回复
热议问题