dist/toolkit.js
function(content, options) {
        options = $.extend({}, this.options, options || {});

        var self = this,
            toast = this.render(options.template)
                .addClass(options.animation)
                .attr('role', 'note')
                .html(content)
                .conceal()
                .prependTo(this.wrapper);

        this.fireEvent('create', [toast]);

        // Set a timeout to trigger show transition
        setTimeout(function() {
            self.show(toast);
        }, 15); // IE needs a minimum of 15

        // Set a timeout to remove the toast
        if (options.duration) {
            setTimeout(function() {
                self.hide(toast);
            }, options.duration + 15);
        }
    }
function(content, options) {
        options = $.extend({}, this.options, options || {});

        var self = this,
            toast = this.render(options.template)
                .addClass(options.animation)
                .attr('role', 'note')
                .html(content)
                .conceal()
                .prependTo(this.wrapper);

        this.fireEvent('create', [toast]);

        // Set a timeout to trigger show transition
        setTimeout(function() {
            self.show(toast);
        }, 15); // IE needs a minimum of 15

        // Set a timeout to remove the toast
        if (options.duration) {
            setTimeout(function() {
                self.hide(toast);
            }, options.duration + 15);
        }
    }
function ( content , options ) { options = $ . extend ( { } , this . options , options || { } ) ; var self = this , toast = this . render ( options . template ) . addClass ( options . animation ) . attr ( 'role' , 'note' ) . html ( content ) . conceal ( ) . prependTo ( this . wrapper ) ; this . fireEvent ( 'create' , [ toast ] ) ; // Set a timeout to trigger show transition setTimeout ( function ( ) { self . show ( toast ) ; } , 15 ) ; // IE needs a minimum of 15 // Set a timeout to remove the toast if ( options . duration ) { setTimeout ( function ( ) { self . hide ( toast ) ; } , options . duration + 15 ) ; } }
Create a toast element, insert content into it, and append it to the container.

@param {*} content
@param {Object} [options]
Create a toast element insert content into it and append it to the container .