I like the Bootstrap library by Twitter and I would like to try to use into it in my simple page. I need there after loading the page automatically display the modal window. Could anyone give me a tip, how is possible to do it?
I like the Bootstrap library by Twitter and I would like to try to use into it in my simple page. I need there after loading the page automatically display the modal window. Could anyone give me a tip, how is possible to do it?
Share Improve this question edited Aug 10, 2019 at 18:02 Brian Tompsett - 汤莱恩 5,88372 gold badges61 silver badges133 bronze badges asked Jan 28, 2012 at 12:52 user984621user984621 48.5k76 gold badges233 silver badges427 bronze badges3 Answers
Reset to default 9well that shouldn't be too hard... do something like this:
jQuery(document).ready(function($) {
$('#my-modal').modal(options)
});
Your modal...
<div class="modal fade" id="formSaludo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
If ulike modal opened... Use style="display: block;" and class="modal fade in"
<div class="modal fade in" id="formSaludo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: block;">
This modal load when the page is ready.
<body>
<div id="top">
<a tabindex="-1" href="#" id="metadata-link" data-target="#modal" data-toggle="modal">Metadata</a>
</div>
<div id="modal" class="modal hide fade in" style="display:none;">
<div class="modal-header">header<a class="close" data-dismiss="modal">x</a></div>
<div class="modal-body"></div>
<div class="modal-footer">footer</div>
</div>
<script>
$(document).ready(function() {
$('#top').find('a').trigger('click');
});
</script>
Best regards.