Slide down animation from display:none to display:block?

前端 未结 5 1222
无人共我
无人共我 2020-12-14 07:47

Is there a way to animate display:none to display:block using CSS so that the hidden div slides down instead of abruptly appearing, or should I go about this a different way

5条回答
  •  一个人的身影
    2020-12-14 08:21

    You can use also

    $('#youDiv').slideDown('fast');
    

    or you can tell that the active div goes up then the called one goes down

    $('.yourclick').click(function(e) {
           var gett = $(this).(ID);
           $('.youractiveDiv').slideUp('fast', function(){
            $('.'+gett).slideDown(300);
           });
    });
    

    Something like that.

提交回复
热议问题