(function($){ //*********************** // toastee plugin v1.0 // super light weight toast notification plugin ( requires jQuery ) // author: Eric Rogers // options: { // type: 'info', 'error', 'success', // header: 'your header text', // message: 'your message', // color: 'text and close button color', // background: 'background color', // width: takes an integer (default is 150), // height: takes an integer (default is 150) // } //********************** $.fn.toastee = function(options) { var settings = $.extend ({ type: 'info', header: '', message: 'What a great Toast!', color: '#fff', background: '#3498db', width: 200, height: 150, fadeout: 3000 }, options); var self = this; var dataId = Math.floor(Math.random() * 100000); var backgrounds = {'info': '#3498db', 'error': '#e74c3c', 'success': '#2ecc71'}; var headers = {'info': 'Info', 'error': 'Error!', 'success': 'Success!'}; if (options == undefined) { options = {'empty': 'empty'}; } switch (settings.type) { case 'info': settings.background = options.background || backgrounds.info; settings.header = options.header || headers.info; break; case 'error': settings.background = options.background || backgrounds.error; settings.header = options.header || headers.error; break; case 'success': settings.background = options.background || backgrounds.success; settings.header = options.header || headers.success; }; var toast = '
' + settings.message + '
'; toast += '