<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html, body {
padding: 0;
margin: 0;
height: 100%;
}
.wrapper {
display: none;
position: fixed;
width: 100%;
height: 100%;
overflow: auto;
}
.wrapper_fon {
display: none;
position: fixed;
width: 100%;
height: 100%;
background-color: #000;
opacity: 0.4;
filter: Alpha(opacity=40);
}
.wrapper .overlay {
position: relative;
padding: 10px;
}
.wrapper .overlay .list {
width: 400px;
margin: 0 auto;
background-color: #fff;
}
</style>
<script type="text/javascript">
function openOverlay() {
document.body.style.overflow = 'hidden';
document.querySelector('.wrapper_fon').style.display = 'block';
document.querySelector('.wrapper').style.display = 'block';
return false;
}
function closeOverlay() {
document.body.style.overflow = 'auto';
document.querySelector('.wrapper_fon').style.display = 'none';
document.querySelector('.wrapper').style.display = 'none';
return false;
}
</script>
</head>
<body>
<div class="wrapper_fon"></div>
<div class="wrapper">
<div class="overlay">
<div class="list">
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
text<br/>
<a href="" onclick="return closeOverlay();">закрыть</a>
</div>
</div>
</div>
<div>
<a href="" onclick="return openOverlay();">открыть</a><br/>
<img src="http://sonicsquad.ucoz.ru/_nw/2/72557.jpg" width="800" height="600" alt="" />
</div>
</body>
</html>