Here is the code you can use to create the overlay:
overlay = function () {
var o, c;
this.create = function (html) {
o = $('<div />');
c = $('<div />');
h = $('<div>' + html + '</div>').appendTo(c);
var o_css = {
'position': 'absolute',
'top': '0',
'left': '0',
'width': '100%',
'height': '100%',
'background': '#000',
'z-index': '10000',
'overflow': 'hidden'
};
var c_css = {
'position': 'absolute',
'top': '50%',
'left': '50%',
'width': '300px',
'height': '200px',
'margin-left': '-150px',
'margin-top': '-100px',
'background': '#fff',
'color': '#000',
'z-index': '10001'
};
var h_css = { 'padding': '10px' };
o.css(o_css);
c.css(c_css);
h.css(h_css);
o.fadeTo(0, 0).appendTo('body').fadeTo(500, 0.5);
c.fadeTo(0, 0).appendTo('body').fadeTo(500, 1.0);
}
this.remove = function () {
o.remove();
c.remove();
}
}
:
$(document).ready(function () {
o = new overlay();
o.create('HTML you want to fill the container with, example and image or/and text or maybe a link you later bind o.remove() to');
o.remove();
});