How to remove slide down effect from Bootstrap modal?

How to remove slide down effect from Bootstrap modal?

Asked on November 1, 2018 in Bootstrap.
Add Comment


  • 1 Answer(s)

    This can be done by removing the fade Class from Modal.
         On activation the Bootstrap modal window is displayed after a short slide down transition by default.
    So, if you don’t need this and want to remove the animation just take out the fade class from the .modal element.
    For example:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Remove Slide Animation from Bootstrap Modals</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/bootstrap-theme.min.css">
    <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    </head>
    <body>
        <!-- Button HTML (to Trigger Modal) -->
        <a href="#myModal" class="btn btn-lg btn-primary" data-toggle="modal">Launch Demo Modal</a>
        <!-- Modal HTML -->
        <div id="myModal" class="modal">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">Confirmation</h4>
                    </div>
                    <div class="modal-body">
                        <p>Do you want to save changes you made to document before closing?</p>
                        <p class="text-warning"><small>If you don't save, your changes will be lost.</small></p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                        <button type="button" class="btn btn-primary">Save changes</button>
                    </div>
                </div>
            </div>
        </div>
    </body>
    </html>
    

     

    Answered on November 1, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.