First create the css properties for the overlay layer:
#overlay { background: #E7ECF1; filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.90; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 0; }
var overlay = $('<div id="overlay">'); $('#div').append(overlay);
What do you think?