gpt4 book ai didi

twitter-bootstrap - bootbox js 对话框的图标

转载 作者:行者123 更新时间:2023-12-04 08:59:39 32 4
gpt4 key购买 nike

有没有人知道如何将图标添加到 bootbox.js 对话框中的按钮?我想在此功能中为“否”和"is"按钮添加图标:

$(function () {
$(".confirm-delete").click(function(e) {
e.preventDefault();
var id = $(this).data('id')
bootbox.confirm("Remove this product?", "No", "Yes", function(confirmed) {
if(confirmed) {
deleteRecord(id);
}
});
});
});

最佳答案

您需要创建自定义对话框并使用icon 配置选项added in 2.1.0 .

例如:

$(function () {
$(".confirm-delete").click(function(e) {
e.preventDefault();
var id = $(this).data('id')
bootbox.dialog("Remove this product?", [{
"label" : "No",
"icon" : "icon-remove"
}, {
"label" : "Yes",
"icon" : "icon-ok icon-white",
"callback": function() {
deleteRecord(id);
}
}]);
});
});

Custom dialog example

关于twitter-bootstrap - bootbox js 对话框的图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14573038/

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