jquery add overlay layer to a div or body

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);

By Keenlio, January 21, 2014

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *


4 − = one

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>