Does bootstrap-modal.js require additional javascript?
-
27-10-2019 - |
Question
I'm experiencing issues with twitter's bootstrap-modal javascript.
I'm just using the same code they have on their page
<!-- sample modal content -->
<div id="modal-from-dom" class="modal hide fade">
<div class="modal-header">
<a href="#" class="close">×</a>
<h3>Modal Heading</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<a href="#" class="btn primary">Primary</a>
<a href="#" class="btn secondary">Secondary</a>
</div>
</div>
and then
<button data-controls-modal="modal-from-dom" data-backdrop="true"
data-keyboard="true" class="btn primary">Launch</button>
Of course, when I click on my Launch button nothing happens. Am I supposed to add something to a script.js file?
In my header I am loading jquery, bootstrap and a bunch of other stuff. Should my code work, or is there anything I didn't do correctly?
thx for any answer
Solution
Are you initializing it like this?
$('#modal-from-dom').modal(options)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow