2013-02-15 4 views
1

По какой-то причине у меня возникли проблемы с запуском модульного режима загрузки, ниже мой код.Bootstrap modal not shows

<!DOCTYPE html> 
    <html lang="en"> 
     <head> 
     <link href="http://localhost/scripts/bootstrap/css/bootstrap.min.css" rel="stylesheet"> 
     </head> 
     <body> 
     <div id="modal" class="modal hide fade"> 
       <div class="modal-header"> 
       <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
       <h3>Modal header</h3> 
       </div> 
       <div class="modal-body"> 
       <p>One fine body…</p> 
       </div> 
       <div class="modal-footer"> 
       <a href="#" class="btn">Close</a> 
       <a href="#" class="btn btn-primary">Save changes</a> 
       </div> 
      </div> 
      <button id="button">Fire</button> 
     <script src="http://localhost/scripts/bootstrap/js/bootstrap.min.js"></script> 
     <script src="http://code.jquery.com/jquery-latest.js"></script> 
     <script> 
      $(function(){ 
      $("#button").click(function(){ 
       $('#modal').modal('show'); 
      }); 
      }); 
     </script> 
     </body> 
    </html> 

ответ

3

Вы должны включить bootstrap библиотеку послеjQuery библиотеки. Вы пытались проверить консоль своего браузера на наличие каких-либо ошибок?

+2

Отлично, спасибо. – Babiker

+1

Это решило проблему для меня. Каковы причины этого? – piperchester

+0

, если сам bootstrap предоставляет файл .js, зачем нам нужен jquery.js? – Abhinay