You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toastr will supply default animations, so you do not have to provide any of these settings. However you have the option to override the animations if you like.
100
131
101
132
####Easings
102
133
Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery.
103
-
104
-
toastr.options.showEasing = 'swing';
105
-
toastr.options.hideEasing = 'linear';
134
+
```js
135
+
toastr.options.showEasing = 'swing';
136
+
toastr.options.hideEasing = 'linear';
137
+
toastr.options.closeEasing = 'linear';
138
+
```
106
139
107
140
Using the jQuery Easing plugin (http://www.gsgd.co.uk/sandbox/jquery/easing/)
108
-
109
-
toastr.options.showEasing = 'easeOutBounce';
110
-
toastr.options.hideEasing = 'easeInBack';
141
+
```js
142
+
toastr.options.showEasing = 'easeOutBounce';
143
+
toastr.options.hideEasing = 'easeInBack';
144
+
toastr.options.closeEasing = 'easeInBack';
145
+
```
111
146
112
147
####Animation Method
113
148
Use the jQuery show/hide method of your choice. These default to fadeIn/fadeOut. The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery.
114
-
115
-
toastr.options.showMethod = 'slideDown';
116
-
toastr.options.hideMethod = 'slideUp';
149
+
```js
150
+
toastr.options.showMethod = 'slideDown';
151
+
toastr.options.hideMethod = 'slideUp';
152
+
toastr.options.closeMethod = 'slideUp';
153
+
```
117
154
118
155
###Prevent Duplicates
119
156
Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content.
120
-
121
-
toastr.options.preventDuplicates = true;
122
-
157
+
```js
158
+
toastr.options.preventDuplicates = true;
159
+
```
123
160
124
161
###Timeouts
125
162
Control how toastr interacts with users by setting timeouts appropriately. Timeouts can be disabled by setting them to 0.
126
-
127
-
toastr.options.timeOut = 30; // How long the toast will display without user interaction
128
-
toastr.options.extendedTimeOut = 60; // How long the toast will display after a user hovers over it
163
+
```js
164
+
toastr.options.timeOut = 30; // How long the toast will display without user interaction
165
+
toastr.options.extendedTimeOut = 60; // How long the toast will display after a user hovers over it
166
+
```
129
167
130
168
131
169
###Progress Bar
132
170
Visually indicate how long before a toast expires.
0 commit comments