更新时间:2021-07-29 23:55:49
更新说明:修改了消息存储与消息存储数量显示位置
更新时间:2021-06-08 00:52:31
消息推送插件 请各位大佬品尝。
1.消息存储和消息弹出
1.1.消息存储
初始化消息存储位置
<div class="cen"> <div href="javascript:void(0);" title="消息" class="height50"> <div class="smallBell"> </div> </div> </div>
初始化样式
let msgCount = {
id: ".smallBell",
leftData: "0"
};
$.initMsgPopup(msgCount);1.2消息弹出
$.addSmallBellInfo({
time: "2021-01-01 13:01:20",
text: `消息0次`,
type: 0,
callback: (time, text, index) => {
//alert(`你点击的获取的数据是:
${time}--${text}`);
//alert(`你点击的获取的数据是:${time}--${text}`);
let obj = {
title: "消息信息",
content: text
};
$.showPopup(obj, {
defaultsStyle: "info2-color",
hideMilliSeconds:100000,
showLocation:{top:"60px"}
});
});2.样式属性
let defaults = {
defaultsStyle: "error-color",
//默认样式 当样式为custom-color便可以自定义样式
//自定义样式属性
border: {
color: "",
size: "1px",
radius: "5px",
},
background: {
color: "",
},
//消息弹出位置默认右上角
showLocation: {
top: "0px",
right: "0px",
left: "0px",
bottom: "0px"
},
//消息持续显示时间默认5秒
hideMilliSeconds: 5000,
};3.弹出框样式 info-color 默认消息框 info2-color 普通消息框 succeed-color 成功消息框 warning-color 警告消息框 error-color 错误消息框 custom-color 自定义消息框 注:如果有什么问题或更好的意见请联系我。