【问题标题】:Bootstrap Modal Dialog CLICK Event dont worksBootstrap 模态对话框 CLICK 事件不起作用
【发布时间】:2015-07-17 04:46:05
【问题描述】:

我在引导模式对话框中遇到问题, 我不知道如何解决这个问题。 当我在网站上实现 2 个模态对话框时,任一模态对话框上的单击事件有时会触发它的事件,但有时根本不会触发...我确实放置了一个断点,但无论如何它在我单击时并没有进入断点在按钮上..

【问题讨论】:

  • 您需要提供您的代码。没有它,我们不知道如何解决这个问题。

标签: asp.net twitter-bootstrap modal-dialog


【解决方案1】:

我认为两个模型的某些数据是相同的。试试看

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>


<!-- Large modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Large modal</button>

<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      Large modal
    </div>
  </div>
</div>

<!-- Small modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm">Small modal</button>

<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      Small modal
    </div>
  </div>
</div>

【讨论】:

  • 答案不应该只包含代码,你应该描述它是如何解决问题的。
  • @MaartenBodewes 对不起,我听不懂。请解释一下。
  • 请描述如何解决“任一模式对话框上的点击事件有时会触发它的事件,但有时根本不会触发”。这不是对错误的非常清楚的描述,但只要问题没有更好,那就是您必须回答的问题。 只显示生成两个模型对话框的代码不构成答案。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多