Skip to content

Instantly share code, notes, and snippets.

@ericf
Created June 3, 2010 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericf/424223 to your computer and use it in GitHub Desktop.
Save ericf/424223 to your computer and use it in GitHub Desktop.
YUI().use('node', function(Y){
Y.one('#foo').on('click', function(e){
// Lazy-use OverlayModal.
// Create and show a new modal Overlay.
Y.use('gallery-overlay-modal', function(){
var myModalOverlay = new Y.Overlay({
bodyContent : '<p>I am modal!</p>',
width : '300px',
height : '150px',
zIndex : 100,
render : true,
plugins : [{ fn: Y.Plugin.OverlayModal }]
});
});
});
Y.one('#bar').on('click', function(e){
// Lazy-use OverlayExtras.
// Create and show a new modal Overlay with autohide.
Y.use('gallery-overlay-extras', function(){
var myModalAutohidingOverlay = new Y.Overlay({
bodyContent : '<p>I am modal and autohide!</p>',
width : '300px',
height : '150px',
zIndex : 100,
render : true,
plugins : [
{ fn: Y.Plugin.OverlayModal },
{ fn: Y.Plugin.OverlayAutohide }
]
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment