Mizuchi Mizuchi - 1 year ago 136
CSS Question

BootStrap Javascript Modal

Ok, so I attempted to implement a modal to my website but to my dismay, I've run into a problem where the firstly the modal is faded out and secondly, the text doesn't display nor am I able to click away.
The modal on my website

<button type="button" class="btn btn-blue btn-effect" data-toggle="modal" data-target="#myModal">HORRAY!</button>

<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times</button>
<h4 class="modal-title">Modal Header</h4>
<div class="modal-body">
<p>Some text in the modal.</p>
<div class="modal-footer">


edit: I'm very new to Javascript, I only start coding again after a 5 year hiatus
edit: after trying fiddle, i've come to a guess that it's an issue in my css

Answer Source

If your code is like this one, I believe the problem is in the space between data-dismiss. Despite that your code works just fine

<button type="button" class="btn btn-default" data-          dismiss="modal">Close</button>


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download