Toastr JS设置fadeAway值 [英] Toastr JS Setting fadeAway value

查看:171
本文介绍了Toastr JS设置fadeAway值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个很酷的警报js库项目: https://github.com/CodeSeven/toastr

I am using a cool alert js library Project: https://github.com/CodeSeven/toastr

我希望在一段时间后退出以下更改。
查看toastr.js文件,我确实看到了选项。
我只是不知道如何访问该物业'fadeAway'

I wanted to fadeOut the following alter after a period of time. Looking at the toastr.js file, I do see the options are there. I just dont know how to access the property 'fadeAway'

toastr.info('Processing...');

我试过

toastr.info('Processing...', fadeAway:1000);

如何通过传入参数来使用fadeAway?

How do I use the fadeAway by passing in a parameter ?

推荐答案

在调用toastr.info之前,请设置您选择的选项。例如:

Before you call toastr.info, set the option you choose. For example:

toastr.options.fadeOut = 2500;

您可以在此处看到演示中的许多选项:toastr demo

You can see many of the options in the demo here: toastr demo

这些是默认值。你可以覆盖其中许多:

These are the defaults. You can override many of them:

options = {
  tapToDismiss: true,
  toastClass: 'toast',
  containerId: 'toast-container',
  debug: false,
  fadeIn: 300,
  fadeOut: 1000,
  extendedTimeOut: 1000,
  iconClass: 'toast-info',
  positionClass: 'toast-top-right',
  timeOut: 5000, // Set timeOut to 0 to make it sticky
  titleClass: 'toast-title',
  messageClass: 'toast-message'
}

这篇关于Toastr JS设置fadeAway值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆