当前位置:

iNotify.js浏览器系统通知插件 v2.1.0

收藏
举报
iNotify.js主要是调用 Chrome、Firefox、Safari 等浏览器提供的系统通知 API,实现浏览器系统通知,实现 title 标签 闪烁、滚动、声音提示。favicon 图标数字信息通知,声音播放等.....
  • 作者:
    暂无
  • 演示网站:
    暂无
  • 当前版本:
    v2.1.0
  • 日期:
    2022-07-28
  • 相关链接:
    Home Page
  • 所属分类:
    插件与扩展 JavaScript
  • 软件评级:
  • 下载人气:
    417
免费下载
求购此源码
应用截图
源码详情
免费下载
联系客服/入群
源码属性
授权 开源
大小 270.86KB
语言 JavaScript
运行环境 JavaScript
功能介绍

iNotify.js主要是调用 Chrome、Firefox、Safari 等浏览器提供的系统通知 API,实现浏览器系统通知,实现 title 标签 闪烁、滚动、声音提示。favicon 图标数字信息通知,声音播放等.....


结构

message: String 标题
effect: String, flash | scroll | favicon 闪烁还是滚动
audio: 可选播放声音
  file: String/Array 可以使用数组传多种格式的声音文件
interval: Number 标题闪烁,或者滚动速度
openurl: String 点击弹窗打开连接地址
onclick: Function 弹窗点击事件
updateFavicon: 设置 Favicon 图标颜色
  textColor: 设置 favicon 字体颜色
  backgroundColor: 背景颜色,设置背景颜色透明,将值设置为 transparent
notification: 可选 chrome 浏览器通知,默认不填写就是下面的内容
  title: 默认值 通知!
  icon: 设置图标 icon 默认为 Favicon

  body: 设置消息内容


例子

实例一
function iconNotify(num) {
  if (!notify) {
    var notify = new Notify({
      effect: "flash",
      interval: 500,
    });
  }
  if (num === 0) {
    notify.faviconClear();
    notify.setTitle();
  } else if (num < 100) {
    notify.setFavicon(num);
    notify.setTitle("有新消息!");
  } else if (num > 99) {
    notify.setFavicon("..");
    notify.setTitle("有新消息!");
  }
}
实例二

var notify = new Notify({
  effect: "flash",
  interval: 500,
});
notify.setFavicon("1");

实例三

var iN = new Notify({
  effect: "flash",
  interval: 500,
  message: "有消息拉!",
  updateFavicon: {
    // 可选,默认绿底白字
    textColor: "#fff", // favicon 字体颜色
    backgroundColor: "#2F9A00", // 背景颜色
  },
}).setFavicon(10);

实例四

var iN = new Notify().setFavicon(5);

实例五

var iN = new Notify({
  effect: "flash",
  interval: 500,
  message: "有消息拉!",
  audio: {
    file: "msg.mp4",
  },
})
  .setFavicon(10)
  .player();

实例六

var iN = new Notify({
  effect: "flash",
  interval: 500,
  message: "有消息拉!",
  audio: {
    file: ["msg.mp4", "msg.mp3", "msg.wav"],
  },
  notification: {
    title: "通知!",
    body: "您来了一条新消息",
  },
});

iN.setFavicon(10).player();

var n = new Notify();
n.init({
  effect: "flash",
  interval: 500,
  message: "有消息拉!",
  audio: {
    file: ["openSub.mp4", "openSub.mp3", "openSub.wav"],
  },
  notification: {
    title: "通知!",
    icon: "",
    body: "您来了一个客户",
  },
});

n.setFavicon(10).player();


付费服务
模板/插件

联系客服

手机版

扫一扫进入手机版

返回顶部