My modal window is not appearing as a pop-up

1.1k views Asked by At

My modal window is not appearing as a pop-up when clicked on "View Video". Instead its displaying just as any other div element in the same page. Can anyone please help.

<div class="content-intro">
       <a href="#myModal" data-toggle="modal">View Video</a> 
    </div>  

    <div class="modal" id="myModal" style="display: none" aria-hidden="true">
          <div class="modal-dialog">
            <div class="modal-content">
             <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>                
             </div>
              <div class="modal-body">
                My video 
              </div>
            </div>
          </div>
        </div>
2

There are 2 answers

0
jameshwart lopez On

You are missing data-target="#myModal"

Just make your link like this

<a href="#" data-target="#myModal" data-toggle="modal">View Video</a> 
0
paul On

Try to add the id and the class fade

  <div id="yourModal" class="modal fade" tabindex="-1" data-backdrop="static">

And, how are you opening this modal?. It should be done with modal show

  $('#yourModal').modal('show');