Twitter Bootstrap modal: How to remove Slide down effect

前端 未结 16 2215
野趣味
野趣味 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:41

    I didn't like the slide effect either. To fix this all you have to do is make the the top attribute the same for both .modal.fade and modal.fade.in. You can take off the top 0.3s ease-out in the transitions too, but it doesn't hurt to leave it in. I like this approach because the fade in/out works, it just kills the slide.

    .modal.fade {
      top: 20%;
      -webkit-transition: opacity 0.3s linear;
         -moz-transition: opacity 0.3s linear;
           -o-transition: opacity 0.3s linear;
              transition: opacity 0.3s linear;
    }
    
    .modal.fade.in {
      top: 20%;
    }
    

    If you're looking for a bootstrap 3 answer, look here

提交回复
热议问题