This page demonstrates the Purr Messages module I created and maintain on Drupal.org.
You should see four messages in the top right of the browser, one stacked above the other. They appear when the page loads.
To display these messages I’m simply calling drupal_set_message(). The first message is just a normal message. The second message has the type of ‘sticky’. The third and fourth have the types ‘error’ and ‘warning’. The code is as follows:
drupal_set_message('This is a basic purr message. Hovering over a message will ensure it remains visible.');
drupal_set_message('This is a <strong>sticky</strong> message which is also an <strong>error</strong> and will only clear with user interaction.', 'sticky error');
drupal_set_message('<h2 style="margin:0;padding:0;">This message is a warning!</h2>', 'warning');
drupal_set_message('This fourth purr message has a type of <strong>\'error\'</strong> and will disappear leaving the sticky message above.', 'error');
Generally you’re not going to need to do anything, purr messages will display just fine whenever a Drupal message would usually be shown. There are various settings you can adjust to determine when the standard Drupal messages should be shown or the purr messages. You can also adjust the length of time the purr messages are shown for and how quickly they fade in and out. Finally, you can decide to make all messages sticky.
Find the README.txt here.