Messi is a jQuery plugin to show clean, elegant messages in a simple way. With Messi you will avoid to use default JavaScript alert notifications or new windows to provide extended information to the user.
Display text, html content, images and ajax requests with 5KB code.

Check in GitHub: https://github.com/marcosesperon/Messi/
Simple message:
new Messi('This is a message with Messi.');
new Messi('This is a message with Messi.', {title: 'Title'});
new Messi('This is a message with Messi in modal view. Now you can\'t interact with other elements in the page until close this.', {title: 'Modal Window', modal: true});
new Messi('This is a message with Messi in absolute position.', {center: false, viewport: {top: '760px', left: '0px'}});
Buttons:
new Messi('This is a message with Messi with custom buttons.', {title: 'Buttons', buttons: [{id: 0, label: 'Close', val: 'X'}]});
new Messi('This is a message with Messi with custom buttons.', {title: 'Buttons', buttons: [{id: 0, label: 'Yes', val: 'Y'}, {id: 1, label: 'No', val: 'N'}], callback: function(val) { alert('Your selection: ' + val); }});
new Messi('This is a message with Messi with custom buttons.', {title: 'Buttons', buttons: [{id: 0, label: 'Yes', val: 'Y', btnClass: 'btn-success'}, {id: 1, label: 'No', val: 'N', btnClass: 'btn-danger'}, {id: 2, label: 'Cancel', val: 'C'}]});
Applying styles to title:
new Messi('This is a message with Messi.', {title: 'Title', titleClass: 'success', buttons: [{id: 0, label: 'Close', val: 'X'}]});
new Messi('This is a message with Messi.', {title: 'Title', titleClass: 'info', buttons: [{id: 0, label: 'Close', val: 'X'}]});
new Messi('This is a message with Messi.', {title: 'Title', titleClass: 'anim error', buttons: [{id: 0, label: 'Close', val: 'X'}]});
new Messi('This is a message with Messi.', {title: 'Title', titleClass: 'anim warning', buttons: [{id: 0, label: 'Close', val: 'X'}]});
Other options:
Messi.alert('This is an alert with Messi.');
Messi.ask('This is a question with Messi. Do you like it?', function(val) { alert('Your selection: ' + val); });
Messi.load('login.php', {params: {user: 'demo', password: '1234'}});
Messi.img('messi.jpg');
Messi requires jQuery framework to work, so include it first of all in your project. After that:
<link rel="stylesheet" href="messi.min.css" /> <script src="messi.js"></script>
| Option | Description | Default |
|---|---|---|
autoclose |
Close message after 'x' milliseconds. | null |
buttons |
Array of buttons to show in the foot of the message, i.e: [{id: 'ok', label: 'OK', val: 'OK', btnClass: ''}]. | [] |
callback |
Callback function after close the message. | null |
center |
Centers message on the viewport. | true |
closeButton |
Show close button in header title (or content if buttons array is empty). | true |
height |
Content height. | 'auto' |
title |
Text title in the message. | null |
titleClass |
Title background CSS style: info, warning, success, error, anim. | null |
modal |
Shows message in modal view (load background div). | false |
modalOpacity |
If modal, set the div's opacity. | .2 |
padding |
Sets the content padding. | '10px' |
show |
Show message after load. | true |
unload |
Unload message from DOM after hide. | true |
viewport |
If not center message, sets X and Y positions. | {top: '0px', left: '0px'} |
width |
Message width. | '500px' |
zIndex |
Message initial z-index CSS property. | 99999 |
1.3 [13/03/2013]
1.2 [31/01/2013]
1.1 [01/05/2012]
1.0 [30/04/2012]
Messi is a plugin for jQuery JavaScript framework.
Based on Jason Frame's project Boxy.
Style classes for buttons are from Twitter Bootstrap's project.