File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,20 @@ Toastify({
77
77
78
78
+ See the [ changelog] ( https://github.com/apvarun/toastify-js/blob/master/CHANGELOG.md )
79
79
80
+ ### Add own custom classes
81
+
82
+ If you want to use custom classes (like info or warning for example) you can do that via
83
+
84
+ ``` javascript
85
+ Toastify ({
86
+ text: " This is a toast" ,
87
+ backgroundColor: " linear-gradient(to right, #00b09b, #96c93d)" ,
88
+ classes: " info"
89
+ }).showToast ();
90
+
91
+ ```
92
+
93
+
80
94
## Browsers support
81
95
82
96
| [<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/edge.png" alt="IE / Edge" width="16px" height="16px" />](http://godban.github.io/browsers-support-badges/)<br />IE / Edge | [<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/firefox.png" alt="Firefox" width="16px" height="16px" />](http://godban.github.io/browsers-support-badges/)<br />Firefox | [<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/chrome.png" alt="Chrome" width="16px" height="16px" />](http://godban.github.io/browsers-support-badges/)<br />Chrome | [<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/safari.png" alt="Safari" width="16px" height="16px" />](http://godban.github.io/browsers-support-badges/)<br />Safari | [<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/opera.png" alt="Opera" width="16px" height="16px" />](http://godban.github.io/browsers-support-badges/)<br />Opera |
Original file line number Diff line number Diff line change 54
54
this . options . positionLeft = options . positionLeft || false ; // toast position - left or right
55
55
this . options . backgroundColor = options . backgroundColor || "linear-gradient(135deg, #73a5ff, #5477f5)" ; // toast position - left or right
56
56
this . options . avatar = options . avatar || "" ; // toast position - left or right
57
+ this . options . classes = options . classes || "" ; // additional classes for the toast
57
58
58
59
// Returning the current object for chaining functions
59
60
return this ;
69
70
70
71
// Creating the DOM object
71
72
var divElement = document . createElement ( "div" ) ;
72
- divElement . className = 'toastify on' ;
73
+ divElement . className = 'toastify on ' + this . options . classes ;
73
74
74
75
// Positioning toast to left or right
75
76
if ( this . options . positionLeft === true ) {
You can’t perform that action at this time.
0 commit comments