My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
PluginMiniMessage  
OpenSocial jQuery Mini Message is plugin to display the message to the user
jQuery.fn.minimessage
en, ja
Updated Feb 26, 2010 by nakajim...@gmail.com

After loading OpenSocial jQuery proper, please continue and load OpenSocial jQuery Mini Message

<script type="text/javascript" src="opensocial-jquery.js"></script>
<script type="text/javascript" src="opensocial-jquery.minimessage.js"></script>

minimessage is required for OpenSocial jQuery Mini Message

<Require feature="minimessage" />

Displaying a Message with a Close Button

jQuery.fn.minimessage can be used to display a message with a close button

$('<span/>').text('Dismissible Message').minimessage();

Moreover, jQuery.fn.minimessage can specify a callback function and can undertake the handling of closing an event. If the return value for the callback function is false, the event is rendered invalid, and the message does not close.

$('<span/>').text('Dismissible Message with Callback')
  .minimessage(function() {
    return confirm('Do you close a message?');
  });

Closing a Message

jQuery.fn.remove can be used to close a message

var message = $('<a/>').text('Remove Message')
  .click(function() {
    message.remove(); return false;
  }).minimessage();
});

Message Closes Automatically

jQuery.fn.minimessage can be used to display an automatically-closing message. The number of seconds prior to closing can be set using the fast, normal, or slow options.

  • If fast is selected, the message is closed after 1 second
  • If normal is selected, the message is closed after 3 seconds
  • If slow is selected, the message is closed after 5 seconds
$('<span/>').text('Timer Message').minimessage(3);
$('<span/>').text('Timer Message with Predefined Speeds').minimessage('slow');

Moreover, jQuery.fn.minimessage can specify a callback function and can undertake the handling of closing an event.

$('<span/>').text('Timer Message with Callback')
  .minimessage('fast', function() {
    alert('The message was closed.');
  });

Actual Examples


Sign in to add a comment
Powered by Google Project Hosting