Question

I am trying to make functioning bootstrap model, but it does not work.Not able to find what I am missing. jsfiddle: jsFiddle link here

<div id="modal-3" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
    <p>One fine body…</p>
</div>
<div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">No</button>
    <button class="btn btn-primary" data-dismiss="modal">Yes</button>
</div>

<a href="#modal-3" role="button" class="btn" data-toggle="modal">Confirm</a>
Was it helpful?

Solution

Remove the hide class on the modal container. It is redundant with the modal itself. Working example:

<div id="modal-3" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> ...

OTHER TIPS

You are missing, bootstrap.min.js or bootstrap modal.js , don't forget to initiate.

add $('#myModal').modal(); or $('#myModal').modal({ options }); at the bottom of your script.

more about bootstrap modal APIs

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top