检测Jquery Noty通知是否已关闭

时间:2015-09-21 10:43:53

标签: jquery noty

有没有办法检测是否已使用JQuery本身关闭了JQuery Noty通知?

我的主页上有Noty通知。我想检测通知何时关闭。任何人都可以帮忙吗?

Noty:

var n = noty({
  layout: 'topCenter',
  theme: 'relax',
  type: 'information',
  force: false,
  text: 'This one worked',
  animation: {
    open: 'animated zoomIn', // Animate.css class names
    close: 'animated zoomOut', // Animate.css class names
  }
});

1 个答案:

答案 0 :(得分:1)

有一种方法称为“回调”'在诺伊。这就是我用它在关闭时检测的方式:

var n = noty({
  layout: 'topCenter',
  theme: 'relax',
  type: 'information',
  force: false,
  text: 'This one worked',
  animation: {
    open: 'animated zoomIn', // Animate.css class names
    close: 'animated zoomOut', // Animate.css class names
  },
  callback: {
    onClose: function() {
      Cookies.set('ShowNoty', false);
    },
  },
});