When you display some important data and form like login etc, then you need to overlay hide and show on javascript function onClick.
At following, I am giving proper overlay code.
Javascript : There is given javascript function, which used to show and hide overlay through onClick. There is given to function, these are following.
1. function loginForm(){
document.getElementById("contentWrap").style.display="block";
document.getElementById("overlay").style.display="block";
}
For showing overlay and content.
2. function loginFormClose(){
document.getElementById("contentWrap").style.display="none";
document.getElementById("overlay").style.display="none";
}
For hiding overlay and content.
CSS : Overlay effect shown due to style property, following css used for overlay display.
.overlay {
background:#000;
opacity:0.8;
filter:alpha(opacity=80);
position:fixed;
top:0px;
bottom:0px;
left:0px;
right:0px;
z-index:100;
}
.contentWrap {
position:fixed;
top:50px;
color:#7F7F7F;
z-index:101;
width:100%;
margin:0 auto
}
Following is total code, just copy from text area and run browser and check how is this working.
At following, I am giving proper overlay code.
Javascript : There is given javascript function, which used to show and hide overlay through onClick. There is given to function, these are following.
1. function loginForm(){
document.getElementById("contentWrap").style.display="block";
document.getElementById("overlay").style.display="block";
}
For showing overlay and content.
2. function loginFormClose(){
document.getElementById("contentWrap").style.display="none";
document.getElementById("overlay").style.display="none";
}
For hiding overlay and content.
CSS : Overlay effect shown due to style property, following css used for overlay display.
.overlay {
background:#000;
opacity:0.8;
filter:alpha(opacity=80);
position:fixed;
top:0px;
bottom:0px;
left:0px;
right:0px;
z-index:100;
}
.contentWrap {
position:fixed;
top:50px;
color:#7F7F7F;
z-index:101;
width:100%;
margin:0 auto
}
Following is total code, just copy from text area and run browser and check how is this working.
Hope so it will helpful to you and following is screen shot of working site.
1.
2.
Above is overlay effect showing.


It's Perfect code for overlay..
ReplyDeletewhat should be changed if i want it as onload overlay?
ReplyDeleteA Python and Django course blends programming basics with framework expertise.It focuses on scalable application design.This Python and Django course enhances learning.It is dependable.
ReplyDelete⭐ BA Analyst Course Online
ReplyDeleteA structured BA analyst course online builds your expertise in requirement analysis and business strategy.
The curriculum includes gap analysis, UML diagrams, and use case development.
Hands-on exercises and assignments deepen your practical experience.
Live case studies simulate industry challenges to boost your skills.
Trainer support ensures clear learning of every module.
Flexible timings suit learners from different backgrounds.
This course sets you on a strong career path in business analysis.