0
似乎只彈出給定頁面上的一個模式。定義的第一個模式似乎是唯一打開的模式。如果我改變了模態定義的順序,那麼新的「第一」模式可以工作,但其他模式不能。任何線索,爲什麼這是這種情況?只有一個引導模式打開 - 其他模式打開 - 其他模式不顯示
的模態:
<div class="flextable table-actions">
<div class="flextable-item" style="padding-right:5px;">
<div class="btn-toolbar-item input-with-icon">
<button type="button" class="btn btn-xs btn-primary-outline" data-target="#addBudgetOriginal" data-toggle="modal">Original Budget</button>
</div>
</div>
<div class="flextable-item" style="padding-right:5px;">
<div class="btn-toolbar-item input-with-icon">
<button type="button" class="btn btn-xs btn-primary-outline" data-target="#myModal" data-toggle="modal">Approved Budget Change</button>
</div>
</div>
<div class="flextable-item" style="padding-right:5px;">
<div class="btn-toolbar-item input-with-icon">
<button type="button" class="btn btn-xs btn-primary-outline" data-target="#addBudget" data-toggle="modal">Budget Reallocation</button>
</div>
</div>
<div class="flextable-item flextable-primary">
<div class="btn-toolbar-item input-with-icon">
<button type="button" class="btn btn-xs btn-primary-outline" data-target="#addBudget" data-toggle="modal">Pending Budget Reduction</button>
</div>
</div>
限定模態AT MY HTML頁面的底部:
<!-- Modal for Add Budget Transaction -->
{% include 'modals/add_budget_modal - addBudgetOriginal.html' %}
{% include 'modals/add_budget_modal - addBudge.html' %}
<!-- Trigger the modal with a button -->
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
<!-- Modal -->
<div id="myModal" class="modal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
兩個包括塊具有與以下定義模態:
<div id="addBudgetOriginal" class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
AND
<div id="addBudget" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
在這個例子中,只有帶有「#addBudgetOriginal」標籤的模式纔會彈出並打開,因爲這個模式是首先定義的。其他模態不會打開。任何線索爲什麼?謝謝。