gpt4 book ai didi

jquery - Bootstrap 模式不会显示

转载 作者:行者123 更新时间:2023-11-28 03:58:16 24 4
gpt4 key购买 nike

我的模态窗口没有显示在屏幕上时遇到问题,我认为这个问题与 Bootstrap 的淡入淡出 css 类有关,因为当我不包括模态窗口显示的类但没有淡入淡出类时背景全部显示为黑色。

这是我的模态窗口:

function DeleteVenueModal(Name, ID) {
console.log("delete venue function hit");
VenueModalID = ID;

txtVenueModal.innerText = "Delete " + Name;
$("#VenueModal").modal();
}

DeleteVenueModal("Someone", "34");
.modal.fade .modal-dialog {
-webkit-transition: -webkit-transform 0.3s ease-out;
transition: -webkit-transform 0.3s ease-out;
-o-transition: -o-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out, -o-transform 0.3s ease-out;
-webkit-transform: translate(0, -25%);
-o-transform: translate(0, -25%);
transform: translate(0, -25%);
}

.modal-backdrop.fade {
opacity: 0;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="modal fade" id="VenueModal" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 id="txtVenueModal" class="modal-title">Delete </h4>
</div>
<div class="modal-body">
<p>Are you sure you want to permanently delete this venue?</p>

</div>
<div class="modal-footer">
<button type="button" onclick="RemoveVenue();" class="btn btn-success" data-dismiss="modal" style="float: left">Confirm</button>
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>

This is the JavaScript function that opens the modal window:

如果您需要查看更多代码,请询问

最佳答案

通过将我的 Bootstrap 从 NuGet 上可用的最新版本降级到版本 3 解决了这个问题

关于jquery - Bootstrap 模式不会显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43343055/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com