Bootstrap Popup对我不起作用

时间:2015-02-25 06:59:54

标签: twitter-bootstrap

我是bootstrap中的新手。我不知道如何在html页面中添加引导程序弹出窗口。请帮我看看如何在html页面中添加bootstap弹出

2 个答案:

答案 0 :(得分:0)

确保您已在页面中声明了所有javascripts和css: 你可以访问这些链接, http://nakupanda.github.io/bootstrap3-dialog/ http://getbootstrap.com/javascript/

答案 1 :(得分:0)

这是一个简单的演示(部分,取自getbootstrap.com)(你可以复制粘贴它):

    <html>
    <head>
         <!-- jQuery is required -->
         <script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
         <!-- Latest compiled and minified CSS -->
         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">

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

         <!-- Latest compiled and minified JavaScript -->
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
     </head>
     <body>
               <!-- Trigger Button for Modal -->
         <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
           Click To Show Modal
        </button>


        <!--Your Modal Body Here -->
        <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">
                  <!--Your Modal Close Button-->
                  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                  <!--Your Modal Title-->
                <h4 class="modal-title" id="myModalLabel">Please Login</h4>
              </div>
              <div class="modal-body">
                <!--Your Modal content here-->
                  Username: <input type="text" class="form-control"></input>
                  Password: <input type="password" class="form-control"></input>
              </div>
              <div class="modal-footer">

                <button type="button" class="btn btn-primary">Login</button>
                  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              </div>
            </div>
          </div>
        </div>
    </body>
    </html>

结帐这个小提琴:http://jsfiddle.net/gezru4m0/