gpt4 book ai didi

javascript - bootstrap-notify.js - 如何设置页面上允许的最大显示消息?

转载 作者:行者123 更新时间:2023-11-29 15:33:20 27 4
gpt4 key购买 nike

这是我正在使用的 Bootstrap 通知设置:

var options = {
title: title,
message: message
};

var settings = {
element: '#page-wrapper',
position: 'fixed',
type: type,
placement: {
from: "top",
align: "center"
},
z_index: 3000,
animate: {
enter: "animated fadeInDown",
exit: "animated fadeOutUp",
},
template:
'<div data-notify="container" role="alert" class="col-xs-11 col-sm-8 alert alert-{0}" style="margin: 15px 0 15px 0">\
<button type="button" class="close" data-notify="dismiss">\
<span aria-hidden="true">×</span>\
<span class="sr-only">Close</span>\
</button>\
<span data-notify="icon"></span>\
<span data-notify="title">{1}</span>\
<span data-notify="message" style="padding-right:15px">{2}</span>\
<a href="{3}" target="{4}" data-notify="url"></a>\
</div>'
};

$.notify(options, settings);

我想设置在任何时候页面上显示的最大消息数,这样它就不会在页面上充斥着消息。

最佳答案

template:
'<div data-notify="container" role="alert" class="col-xs-11 col-sm-2 alert alert-{0}" style="margin: 15px 0 15px 0; width: 150px;">\
<button type="button" class="close" data-notify="dismiss" style="top:7px;">\
<span aria-hidden="true">×</span>\
<span class="sr-only">Close</span>\
</button>\
<span data-notify="icon"></span>\
<span data-notify="title">{1}</span>\
<span data-notify="message" style="padding-right:15px">{2}</span>\
<a href="{3}" target="{4}" data-notify="url"></a>\
</div>'

给样式添加宽度就可以了!

关于javascript - bootstrap-notify.js - 如何设置页面上允许的最大显示消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32286222/

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