html - Bootstrap modal: class="modal fade" causing problems -


i trying bootstrap modal tutorial work in view.ejs file. class="modal fade" seems causing problem. if remove class="modal fade" modal permanently shows up, if keep in code nothing happens when click on button.

<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#mymodal">open modal</button>  <!-- modal --> <div id="mymodal"  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>             <div class="modal-body">                 <p>some text in modal.</p>             </div>             <div class="modal-footer">                 <button type="button" class="btn btn-default" data-dismiss="modal">close</button>             </div>         </div>     </div> </div> 

from other problems i've found other people have, tried search fade in other css files cannot find anything. tried add before code above, didn't help:

.fade {     opacity: 0;     -webkit-transition: opacity .15s linear;     transition: opacity .15s linear; }  .modal.fade .modal-dialog {     -webkit-transform: translate(0, 0);     -ms-transform: translate(0, 0); // ie9     transform: translate(0, 0); } 

i new web development , might missing small, please me

there might wrong doing, create own fiddle , share here.! used code, , working fine! added modal , fade classes it, , opens when click on button

https://jsfiddle.net/happy2deepak/e5aukzge/

<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#mymodal">open modal</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>             <div class="modal-body">                 <p>some text in modal.</p>             </div>             <div class="modal-footer">                 <button type="button" class="btn btn-default" data-dismiss="modal">close</button>             </div>         </div>     </div> </div> 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -