I have using bootstrap, and I want to show a modal window automatically, without clicking any button. How do I do that? <div class="container"> <a href="#windows1" class="btn btn-primary btn-lg" data-toggle="modal">Botón 1</a> <div class="modal fade" id="windows1"> <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">Header Windows</h4> </div> <div class="modal-body"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque doloremque, ratione impedit velit doloribus commodi illo vitae nesciunt quod quis, accusamus sed itaque officiis aut ullam facilis aperiam possimus ea. </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> </div> HTML:
Dunno how bootstrap does models, but if that modal is hidden using hide(), just do $('#windows1').show();
Sorry I dont understand exactly. My modal is not hidden, window modal to show when I click in a button. That code is in script?
Yes... *shakes head in disbelief* You want to show a modal when the page opens. Then hide the modal EITHER with a class, then swap that class out, or hide it with javascript / jQuery (.hide()) and show() it on page load. This is VERY basic, and if you don't know this, you should perhaps not be making websites. Harsh, but true. Also, you've just shown the code for the modal, nothing else. Since you haven't showed what is in the script, how am I to know what code you already have.
There are so many different ways: http://jsfiddle.net/rahuladmin/rL4jufcL/ http://jsfiddle.net/copist/n3taP/ To find a quick solution Google your question(s) this way: solution i need jsfiddle Change "solution i need" to your own, i.e. show modal on page load jsfiddle