CSS3 transition with jQuery .addClass and .removeClass

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

    I found a way to make this work using jquery easing plugin. Thanks to all for your responses

    $(document).ready(function() {
        $('#menu-item-9').click(function(){
            $('#repair-drop').removeClass('hide');
            $('#repair-drop').animate({"max-height":"500px", "padding-top":"20px", "opacity":"1"},1500, "easeOutCubic");
        });
    $('#repair-drop').on('mouseleave', function(e) {
        setTimeout(function() {
            $('#repair-drop').animate({"max-height":"0px", "overflow":"hidden", "padding":"0px","opacity":"0"},2000, "easeOutCubic");
    
        }, 600);        
    
    });
    });
    

提交回复
热议问题