gpt4 book ai didi

javascript - 空 "
转载 作者:行者123 更新时间:2023-11-30 16:19:32 25 4
gpt4 key购买 nike

我的代码中有模态问题,没有出现,类“modal-backdrop fade in”的 div 是空的。

<body>
<button type="button" title="Usuń" class="deleteButton btn btn-default btn-xs pull-right">Usuń</button>

<div id="confirm" class="modal hide fade">
<div class="modal-body">
Are you sure?
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-primary" id="delete">Delete</button>
<button type="button" data-dismiss="modal" class="btn">Cancel</button>
</div>

$("body").on('click', "button.deleteButton", function (e) {
var clickedButton = $(this);
e.preventDefault();
$('#confirm').modal({ backdrop: 'static', keyboard: false })
.one('click', '#delete', function () {
clickedButton.attr("disabled", true);
});
});

这是我的 fiddle : https://jsfiddle.net/cjdtzsha/

这可能是什么原因?

最佳答案

删除 hide来自 <div id="confirm" class="modal hide fade"> 的类(class)它有 important关于 display:none 的规则属性不允许模态显示。

Remove Hide Selector

现在添加<div class="modal-content"></div>并附上 modal-headermodal-footer在里面

Add modal-content

<div id="confirm" class="modal fade">
<div class="modal-content">
<div class="modal-body">
Are you sure?
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn btn-primary" id="delete">Delete</button>
<button type="button" data-dismiss="modal" class="btn">Cancel</button>
</div>
</div>
</div>

解决所有问题。

关于javascript - 空 "<div class="模态背景淡入“></div>”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34947053/

25 4 0

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