• support@answerspoint.com

Load Bootstrap modal on page load without Use any button.

2170

I have no Idea how to call Modal on a page load. But I can successfully call the Modal on an Button click, but I want it to on a page load.

1Answer


0

You can Easly page load inside a jQuery load event on the head section of your document and it should popup:

 

    <script type="text/javascript">
        $(window).on('load',function(){
        $('#myModal').modal('show');
        });
    </script>
    
        <div class="modal fade" id="myModal">
            <div class="modal-header">
                <a class="close" data-dismiss="modal">×</a>
                <h3>Modal header</h3>
            </div>
            <div class="modal-body">
                 <p>This is Body Part</p>
            </div>
            <div class="modal-footer">
                <a href="#" class="btn">Close</a>
            </div>
        </div>

 

  • answered 6 years ago
  • Community  wiki

Your Answer

    Facebook Share        
       
  • asked 6 years ago
  • viewed 2170 times
  • active 6 years ago

Best Rated Questions