Auto Open Modal

Home Forums Porto – Responsive HTML5 Template Auto Open Modal

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10004967
    fabiomtl
    Participant

    How to open a modal automatically? Like a popup onload.


    #10004975
    Support
    Keymaster

    Hello, you can just add the Bootstrap modal the same way:

    HTML:

    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    	<div class="modal-dialog">
    		<div class="modal-content">
    			<div class="modal-header">
    				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    				<h4 class="modal-title" id="myModalLabel">Modal title</h4>
    			</div>
    			<div class="modal-body">
    				One fine body...
    			</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>

    Then add a JS:
    (js/custom.js)

    $(function () {
    	$('#myModal').modal('show');
    });

    Thanks.


Viewing 2 posts - 1 through 2 (of 2 total)

This topic is marked as "RESOLVED" and can not rceive new replies.