I am using the modal function of Bootstrap 3.0.
I have this code:
<a data-toggle="modal" href="/myNestedContent" data-target="#myModal"> Open the modal containing the content </a> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
When I click on the anchor (link), everything works => I see modal content.
However, when I use the Javascript method (instead of the link) to show the modality as follows:
$('#myModal').modal('show');
I see the fading effect without displaying modality ...
When I started by clicking the link, THEN, calling javascript, it works. (side effect?)
When I started with a javascript image, EVEN, the link only shows the fading effect without modal.
Could this be .. an error from the modal Javascript method?
For information, the declarations of my scripts that I use are in the correct order:
<script src="//code.jquery.com/jquery.js"></script> <script src="javascripts/jquery.form.min.js"></script> <script src="javascripts/bootstrap.min.js"></script>
source share