Twitter引导模式不能在php中工作

时间:2014-03-25 09:56:41

标签: php twitter-bootstrap

<link href="<?php echo base_url(); ?>assets/js/jquery.min.js" type="text/javascript" />
<link href="<?php echo base_url(); ?>assets/js/bootstrap.min.js" type="text/javascript" />

  <div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">  

        <button class="btn btn-default"  data-toggle="modal" data-target="#myModal">
                                +Add Question
                            </button></h3>
  </div>
  <div class="panel-body">

  </div>
</div>


<!-- 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-hidden="true">&times;</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>

我无法打开它的模态似乎很简单但它给出了一个问题。

请帮忙

1 个答案:

答案 0 :(得分:1)

您需要在HTML页面中包含javascript文件中使用<script>标记。

<script src="<?php echo base_url(); ?>assets/js/jquery.min.js" type="text/javascript"></script>

<script src="<?php echo base_url(); ?>assets/js/bootstrap.min.js" type="text/javascript"></script>

在身体标签关闭之前将它们放好:

<script src="<?php echo base_url(); ?>assets/js/jquery.min.js" type="text/javascript"></script>
<script src="<?php echo base_url(); ?>assets/js/bootstrap.min.js" type="text/javascript"></script>
</body>