All, I have been trying to get a lightbox working but seem to be failing. Any constructive help is greatly appreciated.
function lightBoxOn() {
$('#light').show();
$('#fade').show();
};
function lightBoxOff() {
$('#light').hide();
$('#fade').hide();
};
function processData() {
document.write('Yes')
lightBoxOn();
//do some long running stuff
//lightBoxOff();
}
.black_overlay{
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=80);
}
.white_content {
display: none;
position: absolute;
top: 40%;
left: 40%;
width: 20%;
height: 10%;
padding: 16px;
border: 16px solid orange;
background-color: white;
z-index:1002;
overflow: auto;
}
<div>
<input type="button" value="Press Me" onclick="javascript:processData()"/>
</div>
<div id="light" class="white_content">Processing your request...
<a href = "javascript:void(0)" onclick = "javascript:lightBoxOff()">Close</a></div>
<div id="fade" class="black_overlay"></div>
Check this out, I think you are looking for this
WORKING:DEMO
HTML
CSS : NO Change
JS/JQuery