Make twitter Bootstrap popup modal slide and stick to bottom of page

后端 未结 1 1144
星月不相逢
星月不相逢 2020-12-15 01:59

I am using bootstrap 2.3 and I have a modal that slides from the bottom of the page after a few seconds and I want it to stick to the bottom of the screen. Everything is wor

1条回答
  •  被撕碎了的回忆
    2020-12-15 02:38

    The problem is in your CSS. You need to set the bottom property not the top property in order to get your desired result, but you can't do this on the .modal class, you need to do it on the .modal-body class.

    Demo

    CSS:

    .modal.fade.in .modal-body {
        bottom: 0; 
    }
    .modal-body {
        position: absolute;
        bottom: -250px;
        right: 5%;
        padding: 15px;
        width: 275px;
        height: 250px;
        background-color: #e5e5e5;
        border-radius: 6px 6px 0 0;
        -webkit-transition: bottom 0.3s ease-out;
        -moz-transition: bottom 0.3s ease-out;
        -o-transition: bottom 0.3s ease-out;
        transition: bottom 0.3s ease-out;
    }
    .close {
        margin-top: -20px;
        text-shadow: 0 1px 0 #ffffff;
    }
    .popup-button {
        margin-left: 140px;
        margin-top: 77px;
        font-weight: bold;
    }
    

    HTML:

    
    

    0 讨论(0)
提交回复
热议问题