Modal在打开时关闭

时间:2014-09-19 16:32:21

标签: ruby-on-rails twitter-bootstrap bootstrap-modal

我正在尝试在我的应用程序上使用模态,并且发生了一些奇怪的事情。当我按下按钮打开模态时,它会弹出并立即消失。我可以在关闭之前看到模态内容一秒钟。这是我的基本模态代码:

   <button class="btn btn-primary" type="button" data-toggle="modal" data-target="#myModal">Upload Images</button> <div class="spacer"></div>
  <textarea class="autosize-transition form-control" placeholder="Please enter information." id="form-field-11" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 200px; width: 720px"></textarea>

  <!-- 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">Modal title</h4>
          </div>
          <div class="modal-body">
            This is where you insert the content you want to display in the modal.
          </div>
          <div class="modal-footer">
            <!-- footer area with buttons for a continued dialog -->
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary">Save changes</button>
          </div>
        </div><!-- /.modal-content -->
      </div><!-- /.modal-dialog -->
    </div><!-- /.modal --> 
我是否正在使用能够实现这一目标的课程?我不知道为什么这样做会如此,我希望我的问题足够清楚,以便你帮助我解剖它并帮助我。感谢任何提前知道为什么我的模态在我打开时正确关闭的人。

0 个答案:

没有答案