css - 需要区分 bootbox.alert() 和 bootbox.confirm() 两种样式的modal在同一个页面
问题描述
我在同一页面中有多个 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中,您可以看到,给出了可选 className 的选项。
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"
})
您可以为警报创建单独的类并确认并将其传递到选项中
推荐阅读
- spring - 通过springs`WebClient`进行api调用的正确方法是什么,但忽略结果?
- node.js - 用 Express 编写的 API 的 VS Code 中未验证的断点
- amazon-web-services - aws s3 select 是否适用于多个文件?
- node.js - Node.js 从 svg/xml 中删除标签
- python - 绘制带有求和的概率曲线
- amazon-web-services - 删除 cognito 用户和身份对用户访问没有影响
- c# - 如何使用复选框将多个文本框值从视图传递到控制器
- angular - Angular 6 在 *ngfor 表中选择
- python - 如何对查询集进行编码,以便用户只能在个人资料部分看到他们自己的帖子
- python - 字符串列表与排除项的组合