Twitter Bootstrap modal: How to remove Slide down effect

前端 未结 16 2165
野趣味
野趣味 2020-12-07 11:38

Is there a way to change the Twitter Bootstrap Modal window animation from a slide down effect to a fadeIn or just display without the Slide? I read through the documentatio

16条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-07 12:38

    If you like to have the modal fade in rather than slide in (why is it called .fade anyway?) you can overwrite the class in your CSS file or directly in bootstrap.css with this:

    .modal.fade{
        -webkit-transition: opacity .2s linear, none;
        -moz-transition: opacity .2s linear, none;
        -ms-transition: opacity .2s linear, none;
        -o-transition: opacity .2s linear, none;
        transition: opacity .2s linear, none;
        top: 50%;
    }
    

    If you don't want any effect just remove the fade class from the modal classes.

提交回复
热议问题