A first attempt at a jQuery Plugin. This was inspired by a similar effect you can see on the Twitter.com site. Some of the advantages:
Get download more information- http://showMessage.dingobytes.com/download/
You can install showMessage jQuery Plugin by including the script somewhere in the page AFTER jQuery. This plugin should work on jQuery version 1.3.2+.
<script type="text/javascript" src="/path/to/jquery.showMessage.min.js"
charset="utf-8"></script>
If you wish to style the text, the responses are displayed through an unordered list in the div with id attribute showMessage. Further more you can apply the class of your choice to the notification toolbar.
.notification
{
font-family: Arial, Helvetica, clean, sans-serif;
font-size: large;
font-weight: bold;
background-color: rgb(247, 247, 247);
color: red;
}
.success
{
font-family: Arial, Helvetica, clean, sans-serif;
font-size: large;
font-weight: bold;
background-color: #acfa58;
color: black;
}
.fail
{
font-family: Arial, Helvetica, clean, sans-serif;
font-size: large;
font-weight: bold;
background-color: #fe2e2e;
color: white;
}
Here are the possible options with their default values:
thisMessage: [''], className: 'notification', position: 'top', zIndex: 1001, opacity: 90, useEsc: true, displayNavigation: true, autoClose: false, delayTime: 5000, closeText: 'close', escText: 'Esc Key or'
jQuery('body').showMessage({
'thisMessage':['<mg src="/images/accept.png" alt="accept"/>successful!']
});
var returnMessage = ['Account was created successfully!','Thank you.'];
jQuery('body').showMessage({
'thisMessage': returnMessage, 'className': 'success', 'opacity': 95, 'displayNavigation': false, 'autoClose': true, 'delayTime': 6000
});