小编Lir*_*ron的帖子

Notify.js 清除旧通知

我正在使用Notify.js在我的网站上显示通知。我遇到了一个问题,我添加通知显示它们,然后,如果我想显示不同的通知并添加它,我也会看到旧的通知。工作流程是:

  1. 用户输入数据
  2. 用户按下按钮
  3. 数据经过验证
  4. 添加了错误通知
  5. 继续直到一切都正确

为了添加通知,我使用以下内容:

var noteOption = {
    // whether to hide the notification on click
    clickToHide : true,
    // whether to auto-hide the notification
    autoHide : false,
    globalPosition : 'bottom right',
    // default style
    style : 'bootstrap',
    // default class (string or [string])
    className : 'error',
    // show animation
    showAnimation : 'slideDown',
    // show animation duration
    showDuration : 400,
    // hide animation
    hideAnimation : 'slideUp',
    // hide animation duration
    hideDuration : 200,
    // padding …
Run Code Online (Sandbox Code Playgroud)

javascript jquery notifications jquery-ui

3
推荐指数
1
解决办法
5936
查看次数

标签 统计

javascript ×1

jquery ×1

jquery-ui ×1

notifications ×1