0

I have found how to disable the auto close of the modal window from bootstrap 3. But i also want to show the window on a page load. When i add the script for this it comes up but then the option for disabling the function to close the modal window when clicked outside of the window doesn't work anymore.

this is the script i use:

`<script type="text/javascript">
    $(window).on('load', function() {
        $('#myModal').modal('show');
    });
</script>`
  

and the modal code:  
   `<div class="modal fade" id="myModal">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">×</button> 
                    <h4 class="modal-title">Notification</h4>                                                             
                </div> 
                <div class="modal-body">
                    Are you sure you want to continue?
                </div>   
                <div class="modal-footer">
                    <button type="button" class="btn btn-default align-center" data-dismiss="modal">Close</button> 
                </div>
            </div>                                                                       
        </div>                                          
    </div>`

0 Answers0