Skip to content

Instantly share code, notes, and snippets.

@ocharles
Created September 15, 2009 22:55
Show Gist options
  • Save ocharles/187735 to your computer and use it in GitHub Desktop.
Save ocharles/187735 to your computer and use it in GitHub Desktop.
Overlay = {
init: function(elementToOverlay, content, options) {
this.options = $.extend({
element: 'div',
attributes: {}
}, options);
this.overlay = $(html[this.options.element](this.options.attributes, content))
.click(this.hideOverlay)
.addClass('overlay-hint')
.show();
this.under = elementToOverlay.hide().after(this.overlay);
this.overlay.show();
},
hideOverlay: function() {
this.under.show();
this.overlay.hide();
}
}
};
Overlay.init.prototype = Overlay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment