0

Моя проблема в том, что модаль не появляется, когда нажимается кнопка.BootStrap Модальный код не работает

Основной ДИВ непосредственно копируется из http://getbootstrap.com/javascript/#modals

Я проверил, что мой линкующего сценариев в голове правильно.

<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head runat="server"> 
     <title></title> 
      <link rel="stylesheet" href="css/bootstrap.css" /> 
     <link rel="stylesheet" href="css/animate.css" /> 
     <script src="css-sheets/bootstrap.js"></script> 
     <script src="js/ChartNew.js"></script> 

    </head> 
    <body> 
     <form id="form1" runat="server"> 
     <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> 
     Launch demo modal 
    </button> 

    <!-- Modal --> 
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 
     <div class="modal-dialog"> 
     <div class="modal-content"> 
      <div class="modal-header"> 
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> 
      <h4 class="modal-title" id="myModalLabel">Modal title</h4> 
      </div> 
      <div class="modal-body"> 
      ... 
      </div> 
      <div class="modal-footer"> 
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> 
      <button type="button" class="btn btn-primary">Save changes</button> 
      </div> 
     </div> 
     </div> 
    </div> 
     </form> 
    </body> 
    </html> 

ответ

0

Бутстрапа есть требование, чтобы Jquery быть использовано для плагин Бутстрапа JQuery как модальности для работы.

Вам нужно добавить тег сценария JQuery перед вашим bootstrap.js, как показано ниже

<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head runat="server"> 
     <title></title> 
      <link rel="stylesheet" href="Content/bootstrap.css" /> 
     <link rel="stylesheet" href="Content/animate.css" /> 
     <script src="Scripts/jquery-1.9.1.min.js"></script> 
     <script src="Scripts/bootstrap.js"></script> 
     <script src="js/ChartNew.js"></script> 

    </head> 
    <body> 
     <form id="form1" runat="server"> 
     <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> 
     Launch demo modal 
    </button> 

    <!-- Modal --> 
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 
     <div class="modal-dialog"> 
     <div class="modal-content"> 
      <div class="modal-header"> 
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> 
      <h4 class="modal-title" id="myModalLabel">Modal title</h4> 
      </div> 
      <div class="modal-body"> 
      ... 
      </div> 
      <div class="modal-footer"> 
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> 
      <button type="button" class="btn btn-primary">Save changes</button> 
      </div> 
     </div> 
     </div> 
    </div> 
     </form> 
    </body> 
    </html> 

вы получите JQuery по ссылке ниже, чтобы загрузить http://jquery.com/

При использовании в вашем коде заменить имена папок с вашими конкретными папками.

Испытан в Chrome версия 39.0.2171.99 м, работает отлично

Надеются, что это решает проблему.

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" /> 
 

 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 
 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> 
 

 
<head runat="server"> 
 
    <title></title> 
 

 
</head> 
 

 
<body> 
 
    <form id="form1" runat="server"> 
 
    <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> 
 
     Launch demo modal 
 
    </button> 
 

 
    <!-- Modal --> 
 
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 
 
     <div class="modal-dialog"> 
 
     <div class="modal-content"> 
 
      <div class="modal-header"> 
 
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span> 
 
      </button> 
 
      <h4 class="modal-title" id="myModalLabel">Modal title</h4> 
 
      </div> 
 
      <div class="modal-body"> 
 
      ... 
 
      </div> 
 
      <div class="modal-footer"> 
 
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> 
 
      <button type="button" class="btn btn-primary">Save changes</button> 
 
      </div> 
 
     </div> 
 
     </div> 
 
    </div> 
 
    </form> 
 
</body>

+0

Было бы очень полезно, если вы могли бы смотреть на это тоже: http://stackoverflow.com/questions/28603984/bootstrap-carousel-shows-animation-only-in-first- горка – user1698232

Смежные вопросы