Skip to content

Instantly share code, notes, and snippets.

@meeech
Created January 31, 2011 04:08
Show Gist options
  • Save meeech/803626 to your computer and use it in GitHub Desktop.
Save meeech/803626 to your computer and use it in GitHub Desktop.
YUI.add('flash-messages', function(Y) {
Y.namespace('mitch');
//@object payload: config options for overlay
Y.Global.on('flash:message', function(payload) {
var overlay = new Y.Overlay(payload);
overlay.get('boundingBox').addClass('flash');
overlay.render("body").show();
Y.later(2000, overlay, function() {
this.get('contentBox').hide('fadeOut', {}, function() {
overlay.destroy();
});
});
});
}, '0.1', {
requires: ['base', 'event-custom', 'overlay']
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment