我正在使用Toastr 2.1JavaScript库来显示瞬态用户输入验证错误消息.我将preventDuplicates选项设置为true.它无法正常工作 - 当用户快速连续点击验证按钮时,我仍然会看到重复的消息(点击速度超过'超时').
这是我的toastr默认值:
function getDefaults() {
return {
tapToDismiss: true,
toastClass: 'toast',
containerId: 'toast-container',
debug: false,
showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
showDuration: 300,
showEasing: 'swing', //swing and linear are built into jQuery
onShown: undefined,
hideMethod: 'fadeOut',
hideDuration: 1000,
hideEasing: 'swing',
onHidden: undefined,
extendedTimeOut: 1000,
iconClasses: {
error: 'toast-error',
info: 'toast-info',
success: 'toast-success',
warning: 'toast-warning'
},
iconClass: 'toast-info',
positionClass: 'toast-top-right',
timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to …Run Code Online (Sandbox Code Playgroud)