Skip to content

Instantly share code, notes, and snippets.

@meltingice
Forked from ocharles/gist:187735
Created September 15, 2009 22:58
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 meltingice/187736 to your computer and use it in GitHub Desktop.
Save meltingice/187736 to your computer and use it in GitHub Desktop.
var that = this;
Overlay = {
init: function(elementToOverlay, content, options) {
that.options = $.extend({
element: 'div',
attributes: {}
}, options);
that.overlay = $(html[that.options.element](that.options.attributes, content))
.click(that.hideOverlay)
.addClass('overlay-hint')
.show();
that.under = elementToOverlay.hide().after(that.overlay);
that.overlay.show();
},
hideOverlay: function() {
that.under.show();
that.overlay.hide();
}
}
};
Overlay.init.prototype = Overlay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment