gpt4 book ai didi

css - 需要区分 bootbox.alert() 和 bootbox.confirm() ,两种风格的模态在同一页面

转载 作者:太空宇宙 更新时间:2023-11-04 01:15:48 28 4
gpt4 key购买 nike

我在同一个页面中有多个 bootbox.alert() 和 bootbox.confirm() 模态框需要清楚地添加不同的样式,但到目前为止运气不好,我如何为这些模态框定义我自己的样式类。

var alertModal = bootbox.alert(
{
title: "<i class='fa fa-exclamation-circle' style='font-size: 20px; color: white'></i> Alert",
message: "Please select Patient from Queue",
})
alertModal.find('.modal-header')
.css(
{
'background-color': 'red',
'color': 'white'
}
);
alertModal.find('.modal-footer')
.css({
'background-color': 'green',
'color': 'white'
}
);

最佳答案

在文档链接中Dialog Options ,您可以看到,给出了可选类名的选项。

var alertModal = bootbox.alert(
{
title: "<i class='fa fa-exclamation-circle' style='font-size: 20px; color: white'></i> Alert",
message: "Please select Patient from Queue",
className:"your custom class name here"
})

您可以为警报创建单独的类并在选项中确认和传递它

关于css - 需要区分 bootbox.alert() 和 bootbox.confirm() ,两种风格的模态在同一页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50202054/

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